Time Series Analysis of Corpus Christi Liquor Distribution


Jenna Ford, Christian Nava and Jonathan Tan
May 21, 2020

Variable Formatting


'data.frame':   375415 obs. of  6 variables:
 $ Customer_ID : int  701000317 701001770 701000317 701001770 701000317 701000317 701001770 701001770 701001770 701001770 ...
 $ Product     : Factor w/ 4017 levels "1800 ANEJO TEQ 6PK 750M",..: 2325 1211 2325 2325 2325 1972 1211 2325 2325 2325 ...
 $ Product_Type: Factor w/ 57 levels "ABSINTHE","AMARETTO",..: 49 29 49 49 49 54 29 49 49 49 ...
 $ STD_Cases   : num  377 361 330 307 280 231 217 192 192 190 ...
 $ Dollar_Sales: num  21987 69846 19246 17904 16498 ...
 $ date        : chr  "3/1/2017" "3/1/2018" "3/1/2018" "3/1/2018" ...

Products


[1] 57  2
Product_Type n
FLAVORED 69425
VODKA 48349
WHISKEY 33177
BOURBON 18838
BLENDS 18737
SILVER 18317
[1] 4017    2
Product n
TAAKA VODKA 80 PET 1.75L 2385
JACK DANIELS BLK WHSKY 1L 2269
TAAKA VODKA 80 1L 2183
CLAN MCGREGOR SCOTCH 1.75L 2091
RICH & RARE CANADIAN WHSKY 1.75L 2068
JACK DANIELS BLK WHSKY 1.75L 1994
[1] 34  2
Customer_ID n
700005448 37041
701001810 21316
701001907 19528
701001904 17879
701000317 17043
701001770 15558
[1] 4017    3
Product_Type Product n
VODKA TAAKA VODKA 80 PET 1.75L 2385
WHISKEY JACK DANIELS BLK WHSKY 1L 2269
VODKA TAAKA VODKA 80 1L 2183
SCOTCH CLAN MCGREGOR SCOTCH 1.75L 2091
BLENDS RICH & RARE CANADIAN WHSKY 1.75L 2068
WHISKEY JACK DANIELS BLK WHSKY 1.75L 1994
[1] 37391     4
Product_Type Product Customer_ID n
BLENDS CARSTAIRS BLEND 80 1L 700005925 84
BLENDS CARSTAIRS BLEND 80 1L 701000317 84
BLENDS CARSTAIRS BLEND 80 1L 701001790 84
BLENDS RICH & RARE CANADIAN WHSKY 1.75L 700005448 84
BLENDS RICH & RARE CANADIAN WHSKY 1.75L 700005850 84
BLENDS RICH & RARE CANADIAN WHSKY 1.75L 700005861 84

Put Combinations for Forecasting into a Dataframe and Choose 10 Sample Combinations


Product_Type Product Customer_ID
WHISKEY JACK DANIELS BLK WHSKY 750M 700005895
SILVER TORTILLA SILVER TEQ DSS 1.75L 700005448
GOLD FLOR DE CANA GOLD RUM 4YR 1L 701001904
TEQUILA CASA NOBLE CRYSTAL TEQ 6PK 750M 700005925
LIQUEUR PIRAS 51 CACHACA 80 1L 701001770
VODKA MCCORMICK VODKA 80 1.75L 701001908
VODKA MCCORMICK VODKA 80 TRVL 750M 700005926
BLENDS RICH & RARE CANADIAN RSV 6PK 750M 701001850
SILVER 1800 SILVER TEQ 750M 700005900
FLAVORED FIREBALL CINN WHSKY NL 1.75L 701001907

Time Series EDA & Forecasting


'data.frame':   840 obs. of  4 variables:
 $ date        : Factor w/ 84 levels "1/1/2013","1/1/2014",..: 1 29 36 43 50 57 64 71 78 8 ...
 $ Product_Type: Factor w/ 57 levels "ABSINTHE","AMARETTO",..: 53 53 53 53 53 53 53 53 53 53 ...
 $ Product     : Factor w/ 4017 levels "1800 ANEJO TEQ 6PK 750M",..: 1144 1144 1144 1144 1144 1144 1144 1144 1144 1144 ...
 $ Customer_ID : int  700005895 700005895 700005895 700005895 700005895 700005895 700005895 700005895 700005895 700005895 ...
'data.frame':   840 obs. of  6 variables:
 $ date        : chr  "1/1/2013" "2/1/2013" "3/1/2013" "4/1/2013" ...
 $ Product_Type: Factor w/ 57 levels "ABSINTHE","AMARETTO",..: 53 53 53 53 53 53 53 53 53 53 ...
 $ Product     : Factor w/ 4017 levels "1800 ANEJO TEQ 6PK 750M",..: 1144 1144 1144 1144 1144 1144 1144 1144 1144 1144 ...
 $ Customer_ID : int  700005895 700005895 700005895 700005895 700005895 700005895 700005895 700005895 700005895 700005895 ...
 $ STD_Cases   : num  3 0 1 5 0 0 0 4 0 0 ...
 $ Dollar_Sales: num  582 0 206 970 0 0 0 814 0 0 ...
results <- data.frame(Product_Type=integer(),
                      Product=character(),
                      Customer=integer(),
                      ljung_10=double(),
                      ljung_24=double(),
                      ljung_results=character(),
                      top_5_bic=character(),
                      ADF=double(),
                      PP=double(),
                      KPSS=double(),
                      stationarity_results=character(),
                      EqualMeans_1_ASE=double(),
                      EqualMeans_2_ASE=double(),
                      EqualMeans_3_ASE=double(),
                      EqualMeans_4_ASE=double(),
                      EqualMeans_5_ASE=double(),
                      EqualMeans_6_ASE=double(),
                      EqualMeans_7_ASE=double(),
                      EqualMeans_8_ASE=double(),
                      EqualMeans_9_ASE=double(),
                      EqualMeans_10_ASE=double(),
                      EqualMeans_11_ASE=double(),
                      EqualMeans_12_ASE=double(),
                      ARMA_1_ASE=double(),
                      ARMA_2_ASE=double(),
                      ARMA_3_ASE=double(),
                      ARMA_4_ASE=double(),
                      ARMA_5_ASE=double(),
                      ARMA_6_ASE=double(),
                      ARMA_7_ASE=double(),
                      ARMA_8_ASE=double(),
                      ARMA_9_ASE=double(),
                      ARMA_10_ASE=double(),
                      ARMA_11_ASE=double(),
                      ARMA_12_ASE=double(),
                      ARIMA_1_ASE=double(),
                      ARIMA_2_ASE=double(),
                      ARIMA_3_ASE=double(),
                      ARIMA_4_ASE=double(),
                      ARIMA_5_ASE=double(),
                      ARIMA_6_ASE=double(),
                      ARIMA_7_ASE=double(),
                      ARIMA_8_ASE=double(),
                      ARIMA_9_ASE=double(),
                      ARIMA_10_ASE=double(),
                      ARIMA_11_ASE=double(),
                      ARIMA_12_ASE=double(),
                      ARIMA_S12_1_ASE=double(),
                      ARIMA_S12_2_ASE=double(),
                      ARIMA_S12_3_ASE=double(),
                      ARIMA_S12_4_ASE=double(),
                      ARIMA_S12_5_ASE=double(),
                      ARIMA_S12_6_ASE=double(),
                      ARIMA_S12_7_ASE=double(),
                      ARIMA_S12_8_ASE=double(),
                      ARIMA_S12_9_ASE=double(),
                      ARIMA_S12_10_ASE=double(),
                      ARIMA_S12_11_ASE=double(),
                      ARIMA_S12_12_ASE=double(),
                      stringsAsFactors = FALSE)

# loop through sample combinations
for(i in 1:10) {
  sample_combinations1 = sample_combinations[i,]
  temp1 = inner_join(temp,sample_combinations1)
  product = sample_combinations1$Product
  customer = sample_combinations1$Customer_ID
  product_type = sample_combinations1$Customer_ID
  
  results[i,"Product_Type"] = product_type
  results[i,"Product"] = as.character(sample_combinations1$Product)
  results[i,"Customer"] = customer
  
  par(mfrow=c(1,1))
  plot.ts(temp1$STD_Cases, 
          main=c(paste("Standard Case Sales of ", product), 
                 paste("for Customer",customer)),
          xlab="Months",
          ylab="Standard Cases")
  
  par(mfrow = c(2,2))
  invisible(acf(temp1$STD_Cases, main="ACF"))
  invisible(parzen.wge(temp1$STD_Cases))

  invisible(acf(temp1$STD_Cases[0:length(temp1$date)/2], main="ACF for 1st Half of Series"))
  invisible(acf(temp1$STD_Cases[(1+length(temp1$date)/2):length(temp1$date)], main="ACF for 2nd Half of Series"))
  
  sink("file")
  ljung_10 = ljung.wge(temp1$STD_Cases,K=10)
  sink()
  cat("The Ljung-Box test with K=10 has a p-value of",ljung_10$pval,".")
  results[i,"ljung_10"] = ljung_10$pval
  
  sink("file")
  ljung_24 = ljung.wge(temp1$STD_Cases,K=24)
  sink()
  cat("The Ljung-Box test with K=24 has a p-value of",ljung_24$pval,".")
  results[i,"ljung_24"] = ljung_24$pval
  
  if (ljung_10$pval < .05 & ljung_24$pval < .05){
    print("Ljung-Box test results: At a significance level of 0.05, we reject the null hypothesis that this dataset is white noise.")
    results[i,"ljung_results"] = "not white noise"
  } else if (ljung_10$pval > .05 & ljung_24$pval < .05){
    print("Ljung-Box test results: At a significance level of 0.05, the test is inconclusive.")
    results[i,"ljung_results"] = "inconclusive"
  } else if (ljung_10$pval < .05 & ljung_24$pval > .05){
    print("Ljung-Box test results: At a significance level of 0.05, the test is inconclusive.")
    results[i,"ljung_results"] = "inconclusive"
  } else {
    print("Ljung-Box test results: At a significance level of 0.05, we fail to reject the null hypothesis that this dataset is white noise.")
    results[i,"ljung_results"] = "white noise"
  }
  
  sink("file")
  aic = invisible(aic5.wge(temp1$STD_Cases,type="bic"))
  sink()
  
  for (row in 1:nrow(aic)) {
    if(aic[row,1] == 0 & aic[row,2] == 0){
      print("One of the top 5 models using BIC was an ARMA(0,0), indicating this series may be white noise.")
      results[i,"top_5_bic"] = "white noise"
    }
  }
  
  # Tests for stationarity
  
  # Augmented Dickey-Fuller
  adf=tseries::adf.test(temp1$STD_Cases)
  results[i,"ADF"] = adf$p.value
  
  # Phillips-Perron
  pp=tseries::pp.test(temp1$STD_Cases)
  results[i,"PP"] = pp$p.value
  
  # Kwiatkowski-Phillips-Schmidt-Shin
  kpss=tseries::kpss.test(temp1$STD_Cases)
  results[i,"KPSS"] = kpss$p.value
  
  if (adf$p.value < .05 &  kpss$p.value > .05){
    print("Both stationarity tests indicate this time series is stationary.")
    results[i,"stationarity_results"] = "stationary"
  } else if (adf$p.value >= .05 & kpss$p.value <= .05){
    print("Both stationarity tests indicate this time series is NOT stationary.")
    results[i,"stationarity_results"] = "not stationary"
  } else {
    print("Both tests for stationarity were inconclusive.")
    results[i,"stationarity_results"] = "inconclusive"
  }
  
  j=12
  
  #Equal Means Model
  
  trainingSize = 60
  ASEHolder1 = numeric()
  ASEHolder2 = numeric()
  ASEHolder3 = numeric()
  ASEHolder4 = numeric()
  ASEHolder5 = numeric()
  ASEHolder6 = numeric()
  ASEHolder7 = numeric()
  ASEHolder8 = numeric()
  ASEHolder9 = numeric()
  ASEHolder10 = numeric()
  ASEHolder11 = numeric()
  ASEHolder12 = numeric()

  for( k in 1:(84-(trainingSize + j) + 1))
  {
    sink("file")
    model0_mean = mean(temp1$STD_Cases[k:(k+(trainingSize-1))])
    ASEHolder1[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 1 - 1)] - model0_mean)^2)
    ASEHolder2[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 2 - 1)] - model0_mean)^2)
    ASEHolder3[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 3 - 1)] - model0_mean)^2)
    ASEHolder4[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 4 - 1)] - model0_mean)^2)
    ASEHolder5[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 5 - 1)] - model0_mean)^2)
    ASEHolder6[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 6 - 1)] - model0_mean)^2)
    ASEHolder7[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 7 - 1)] - model0_mean)^2)
    ASEHolder8[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 8 - 1)] - model0_mean)^2)
    ASEHolder9[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 9 - 1)] - model0_mean)^2)
    ASEHolder10[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 10 - 1)] - model0_mean)^2)
    ASEHolder11[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 11 - 1)] - model0_mean)^2)
    ASEHolder12[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 12 - 1)] - model0_mean)^2)
    sink()
    
    assign(paste("EqualMeans_Results_",k,sep=""),(temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + j - 1)] - model0_mean)^2)
  }
  
  WindowedASE1 = mean(ASEHolder1)
  WindowedASE2 = mean(ASEHolder2)
  WindowedASE3 = mean(ASEHolder3)
  WindowedASE4 = mean(ASEHolder4)
  WindowedASE5 = mean(ASEHolder5)
  WindowedASE6 = mean(ASEHolder6)
  WindowedASE7 = mean(ASEHolder7)
  WindowedASE8 = mean(ASEHolder8)
  WindowedASE9 = mean(ASEHolder9)
  WindowedASE10 = mean(ASEHolder10)
  WindowedASE11 = mean(ASEHolder11)
  WindowedASE12 = mean(ASEHolder12)
  results[i,paste0("EqualMeans_1_ASE")] = WindowedASE1
  results[i,paste0("EqualMeans_2_ASE")] = WindowedASE2
  results[i,paste0("EqualMeans_3_ASE")] = WindowedASE3
  results[i,paste0("EqualMeans_4_ASE")] = WindowedASE4
  results[i,paste0("EqualMeans_5_ASE")] = WindowedASE5
  results[i,paste0("EqualMeans_6_ASE")] = WindowedASE6
  results[i,paste0("EqualMeans_7_ASE")] = WindowedASE7
  results[i,paste0("EqualMeans_8_ASE")] = WindowedASE8
  results[i,paste0("EqualMeans_9_ASE")] = WindowedASE9
  results[i,paste0("EqualMeans_10_ASE")] = WindowedASE10
  results[i,paste0("EqualMeans_11_ASE")] = WindowedASE11
  results[i,paste0("EqualMeans_12_ASE")] = WindowedASE12

  #ARMA Model
  
  trainingSize = 60
  ASEHolder1 = numeric()
  ASEHolder2 = numeric()
  ASEHolder3 = numeric()
  ASEHolder4 = numeric()
  ASEHolder5 = numeric()
  ASEHolder6 = numeric()
  ASEHolder7 = numeric()
  ASEHolder8 = numeric()
  ASEHolder9 = numeric()
  ASEHolder10 = numeric()
  ASEHolder11 = numeric()
  ASEHolder12 = numeric()
  
  for( k in 1:(84-(trainingSize + j) + 1))
  {
    sink("file")
    model1 = invisible(aic.wge(temp1$STD_Cases[k:(k+(trainingSize-1))],type="aic"))
    model1_est = invisible(est.arma.wge(temp1$STD_Cases[k:(k+(trainingSize-1))],p=model1$p,q=model1$q))
    forecasts = fore.aruma.wge(temp1$STD_Cases[k:(k+(trainingSize-1))],phi = model1_est$phi, theta = model1_est$theta, s = 0, d = 0,n.ahead = j,plot=FALSE)

    ASEHolder1[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 1 - 1)] - forecasts$f[1:1])^2)
    ASEHolder2[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 2 - 1)] - forecasts$f[1:2])^2)
    ASEHolder3[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 3 - 1)] - forecasts$f[1:3])^2)
    ASEHolder4[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 4 - 1)] - forecasts$f[1:4])^2)
    ASEHolder5[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 5 - 1)] - forecasts$f[1:5])^2)
    ASEHolder6[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 6 - 1)] - forecasts$f[1:6])^2)
    ASEHolder7[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 7 - 1)] - forecasts$f[1:7])^2)
    ASEHolder8[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 8 - 1)] - forecasts$f[1:8])^2)
    ASEHolder9[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 9 - 1)] - forecasts$f[1:9])^2)
    ASEHolder10[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 10 - 1)] - forecasts$f[1:10])^2)
    ASEHolder11[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 11 - 1)] - forecasts$f[1:11])^2)
    ASEHolder12[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 12 - 1)] - forecasts$f[1:12])^2)
    sink()
    
    assign(paste("ARMA_Results_",k,sep=""),(temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + j - 1)] - forecasts$f)^2)

  }
  
  WindowedASE1 = mean(ASEHolder1)
  WindowedASE2 = mean(ASEHolder2)
  WindowedASE3 = mean(ASEHolder3)
  WindowedASE4 = mean(ASEHolder4)
  WindowedASE5 = mean(ASEHolder5)
  WindowedASE6 = mean(ASEHolder6)
  WindowedASE7 = mean(ASEHolder7)
  WindowedASE8 = mean(ASEHolder8)
  WindowedASE9 = mean(ASEHolder9)
  WindowedASE10 = mean(ASEHolder10)
  WindowedASE11 = mean(ASEHolder11)
  WindowedASE12 = mean(ASEHolder12)
  results[i,paste0("ARMA_1_ASE")] = WindowedASE1
  results[i,paste0("ARMA_2_ASE")] = WindowedASE2
  results[i,paste0("ARMA_3_ASE")] = WindowedASE3
  results[i,paste0("ARMA_4_ASE")] = WindowedASE4
  results[i,paste0("ARMA_5_ASE")] = WindowedASE5
  results[i,paste0("ARMA_6_ASE")] = WindowedASE6
  results[i,paste0("ARMA_7_ASE")] = WindowedASE7
  results[i,paste0("ARMA_8_ASE")] = WindowedASE8
  results[i,paste0("ARMA_9_ASE")] = WindowedASE9
  results[i,paste0("ARMA_10_ASE")] = WindowedASE10
  results[i,paste0("ARMA_11_ASE")] = WindowedASE11
  results[i,paste0("ARMA_12_ASE")] = WindowedASE12
  
  #ARIMA Model with d=1
  nulldev()
  temp2 = artrans.wge(temp1$STD_Cases,1)
  dev.off()
  
  trainingSize = 60
  ASEHolder1 = numeric()
  ASEHolder2 = numeric()
  ASEHolder3 = numeric()
  ASEHolder4 = numeric()
  ASEHolder5 = numeric()
  ASEHolder6 = numeric()
  ASEHolder7 = numeric()
  ASEHolder8 = numeric()
  ASEHolder9 = numeric()
  ASEHolder10 = numeric()
  ASEHolder11 = numeric()
  ASEHolder12 = numeric()
    
  for( k in 1:(84-(trainingSize + j) + 1))
  {
    sink("file")
    model1 = invisible(aic.wge(temp2[k:(k+(trainingSize-1-1))],type="aic"))
    model1_est = invisible(est.arma.wge(temp2[k:(k+(trainingSize-1-1))],p=model1$p,q=model1$q))
    forecasts = fore.aruma.wge(temp1$STD_Cases[k:(k+(trainingSize-1))],phi = model1_est$phi, theta = model1_est$theta, s = 0, d = 1,n.ahead = j,plot=FALSE)
    ASEHolder1[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 1 - 1)] - forecasts$f[1:1])^2)
    ASEHolder2[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 2 - 1)] - forecasts$f[1:2])^2)
    ASEHolder3[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 3 - 1)] - forecasts$f[1:3])^2)
    ASEHolder4[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 4 - 1)] - forecasts$f[1:4])^2)
    ASEHolder5[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 5 - 1)] - forecasts$f[1:5])^2)
    ASEHolder6[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 6 - 1)] - forecasts$f[1:6])^2)
    ASEHolder7[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 7 - 1)] - forecasts$f[1:7])^2)
    ASEHolder8[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 8 - 1)] - forecasts$f[1:8])^2)
    ASEHolder9[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 9 - 1)] - forecasts$f[1:9])^2)
    ASEHolder10[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 10 - 1)] - forecasts$f[1:10])^2)
    ASEHolder11[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 11 - 1)] - forecasts$f[1:11])^2)
    ASEHolder12[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 12 - 1)] - forecasts$f[1:12])^2)
    sink()
    
    assign(paste("ARIMA_Results_",k,sep=""),(temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + j - 1)] - forecasts$f)^2)

  }
  
  WindowedASE1 = mean(ASEHolder1)
  WindowedASE2 = mean(ASEHolder2)
  WindowedASE3 = mean(ASEHolder3)
  WindowedASE4 = mean(ASEHolder4)
  WindowedASE5 = mean(ASEHolder5)
  WindowedASE6 = mean(ASEHolder6)
  WindowedASE7 = mean(ASEHolder7)
  WindowedASE8 = mean(ASEHolder8)
  WindowedASE9 = mean(ASEHolder9)
  WindowedASE10 = mean(ASEHolder10)
  WindowedASE11 = mean(ASEHolder11)
  WindowedASE12 = mean(ASEHolder12)
  results[i,paste0("ARIMA_1_ASE")] = WindowedASE1
  results[i,paste0("ARIMA_2_ASE")] = WindowedASE2
  results[i,paste0("ARIMA_3_ASE")] = WindowedASE3
  results[i,paste0("ARIMA_4_ASE")] = WindowedASE4
  results[i,paste0("ARIMA_5_ASE")] = WindowedASE5
  results[i,paste0("ARIMA_6_ASE")] = WindowedASE6
  results[i,paste0("ARIMA_7_ASE")] = WindowedASE7
  results[i,paste0("ARIMA_8_ASE")] = WindowedASE8
  results[i,paste0("ARIMA_9_ASE")] = WindowedASE9
  results[i,paste0("ARIMA_10_ASE")] = WindowedASE10
  results[i,paste0("ARIMA_11_ASE")] = WindowedASE11
  results[i,paste0("ARIMA_12_ASE")] = WindowedASE12
  
  
  #ARIMA Model with S=12
  nulldev()
  temp2 = artrans.wge(temp1$STD_Cases,phi.tr=c(rep(0,11),1))
  dev.off()
  
  trainingSize = 60
  ASEHolder1 = numeric()
  ASEHolder2 = numeric()
  ASEHolder3 = numeric()
  ASEHolder4 = numeric()
  ASEHolder5 = numeric()
  ASEHolder6 = numeric()
  ASEHolder7 = numeric()
  ASEHolder8 = numeric()
  ASEHolder9 = numeric()
  ASEHolder10 = numeric()
  ASEHolder11 = numeric()
  ASEHolder12 = numeric()
  
  for( k in 1:(84-(trainingSize + j) + 1))
  {
    sink("file")
    model1 = invisible(aic.wge(temp2[k:(k+(trainingSize-1-12))],type="aic"))
    model1_est = invisible(est.arma.wge(temp2[k:(k+(trainingSize-1-12))],p=model1$p,q=model1$q))
    forecasts = fore.aruma.wge(temp1$STD_Cases[k:(k+(trainingSize-1))],phi = model1_est$phi, theta = model1_est$theta, s = 12, d = 0,n.ahead = j,plot=FALSE)
    ASEHolder1[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 1 - 1)] - forecasts$f[1:1])^2)
    ASEHolder2[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 2 - 1)] - forecasts$f[1:2])^2)
    ASEHolder3[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 3 - 1)] - forecasts$f[1:3])^2)
    ASEHolder4[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 4 - 1)] - forecasts$f[1:4])^2)
    ASEHolder5[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 5 - 1)] - forecasts$f[1:5])^2)
    ASEHolder6[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 6 - 1)] - forecasts$f[1:6])^2)
    ASEHolder7[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 7 - 1)] - forecasts$f[1:7])^2)
    ASEHolder8[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 8 - 1)] - forecasts$f[1:8])^2)
    ASEHolder9[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 9 - 1)] - forecasts$f[1:9])^2)
    ASEHolder10[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 10 - 1)] - forecasts$f[1:10])^2)
    ASEHolder11[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 11 - 1)] - forecasts$f[1:11])^2)
    ASEHolder12[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 12 - 1)] - forecasts$f[1:12])^2)
    sink()
    
    assign(paste("ARIMAS_Results_",k,sep=""),(temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + j - 1)] - forecasts$f)^2)

  }
  
  WindowedASE1 = mean(ASEHolder1)
  WindowedASE2 = mean(ASEHolder2)
  WindowedASE3 = mean(ASEHolder3)
  WindowedASE4 = mean(ASEHolder4)
  WindowedASE5 = mean(ASEHolder5)
  WindowedASE6 = mean(ASEHolder6)
  WindowedASE7 = mean(ASEHolder7)
  WindowedASE8 = mean(ASEHolder8)
  WindowedASE9 = mean(ASEHolder9)
  WindowedASE10 = mean(ASEHolder10)
  WindowedASE11 = mean(ASEHolder11)
  WindowedASE12 = mean(ASEHolder12)
  results[i,paste0("ARIMA_S12_1_ASE")] = WindowedASE1
  results[i,paste0("ARIMA_S12_2_ASE")] = WindowedASE2
  results[i,paste0("ARIMA_S12_3_ASE")] = WindowedASE3
  results[i,paste0("ARIMA_S12_4_ASE")] = WindowedASE4
  results[i,paste0("ARIMA_S12_5_ASE")] = WindowedASE5
  results[i,paste0("ARIMA_S12_6_ASE")] = WindowedASE6
  results[i,paste0("ARIMA_S12_7_ASE")] = WindowedASE7
  results[i,paste0("ARIMA_S12_8_ASE")] = WindowedASE8
  results[i,paste0("ARIMA_S12_9_ASE")] = WindowedASE9
  results[i,paste0("ARIMA_S12_10_ASE")] = WindowedASE10
  results[i,paste0("ARIMA_S12_11_ASE")] = WindowedASE11
  results[i,paste0("ARIMA_S12_12_ASE")] = WindowedASE12

  
  
  #graph ASEs for each Model
  EqualMeans_Results <- rbind(EqualMeans_Results_1,EqualMeans_Results_2,EqualMeans_Results_3,EqualMeans_Results_4,EqualMeans_Results_5,EqualMeans_Results_6,
                              EqualMeans_Results_7,EqualMeans_Results_8,EqualMeans_Results_9,EqualMeans_Results_10,EqualMeans_Results_11,EqualMeans_Results_12,
                              EqualMeans_Results_13)
  
  ARMA_Results <- rbind(ARMA_Results_1,ARMA_Results_2,ARMA_Results_3,ARMA_Results_4,ARMA_Results_5,ARMA_Results_6,ARMA_Results_7,ARMA_Results_8,
                       ARMA_Results_9,ARMA_Results_10,ARMA_Results_11,ARMA_Results_12,ARMA_Results_13)

  ARIMA_Results <- rbind(ARIMA_Results_1,ARIMA_Results_2,ARIMA_Results_3,ARIMA_Results_4,ARIMA_Results_5,ARIMA_Results_6,ARIMA_Results_7,ARIMA_Results_8,
                         ARIMA_Results_9,ARIMA_Results_10,ARIMA_Results_11,ARIMA_Results_12,ARIMA_Results_13)
      
  ARIMAS_Results <- rbind(ARIMAS_Results_1,ARIMAS_Results_2,ARIMAS_Results_3,ARIMAS_Results_4,ARIMAS_Results_5,ARIMAS_Results_6,ARIMAS_Results_7,ARIMAS_Results_8,
                          ARIMAS_Results_9,ARIMAS_Results_10,ARIMAS_Results_11,ARIMAS_Results_12,ARIMAS_Results_13)
      
  EqualMeans_Means <- colMeans(EqualMeans_Results)
  ARMA_Means <- colMeans(ARMA_Results)
  ARIMA_Means <- colMeans(ARIMA_Results)
  ARIMAS_Means <- colMeans(ARIMAS_Results)
  Combined_Means <- data.frame(EqualMeans_Means,ARMA_Means, ARIMA_Means, ARIMAS_Means)
  Combined_Means$horizon <- as.numeric(row.names(Combined_Means))
  

  g <- ggplot(data=Combined_Means, aes(horizon)) +
    geom_line(aes(y=EqualMeans_Means, color="Equal Means"),size=1.5) +
    geom_line(aes(y=ARMA_Means, color="ARMA"),size=1.5) +
    geom_line(aes(y=ARIMA_Means, color="ARIMA"),size=1.5) +
    geom_line(aes(y=ARIMAS_Means, color="ARIMAS"),size=1.5) +
    scale_color_manual(values = c(
      'Equal Means' = '#58508d',
      'ARMA' = '#bc5090',
      'ARIMA' = '#ff6361',
      'ARIMAS' = '#ffa600'
    )) +
    labs(color='Models') +
    scale_x_continuous(breaks=seq(0,13,1)) +
    ggtitle(paste("Model ASEs for ", product,"and Customer",customer)) +
    xlab("Month Ahead Forecast") +
    ylab("ASE") +
    theme(panel.background = element_blank(), axis.line = element_line(colour = "black"), legend.title = element_blank())
  
  print(g)
}

The Ljung-Box test with K=10 has a p-value of 4.786171e-12 .The Ljung-Box test with K=24 has a p-value of 1.665335e-15 .[1] "Ljung-Box test results: At a significance level of 0.05, we reject the null hypothesis that this dataset is white noise."
[1] "Both tests for stationarity were inconclusive."

The Ljung-Box test with K=10 has a p-value of 0.08807377 .The Ljung-Box test with K=24 has a p-value of 0.3665865 .[1] "Ljung-Box test results: At a significance level of 0.05, we fail to reject the null hypothesis that this dataset is white noise."
[1] "One of the top 5 models using BIC was an ARMA(0,0), indicating this series may be white noise."
[1] "Both stationarity tests indicate this time series is NOT stationary."

The Ljung-Box test with K=10 has a p-value of 0.3801776 .The Ljung-Box test with K=24 has a p-value of 0.1126704 .[1] "Ljung-Box test results: At a significance level of 0.05, we fail to reject the null hypothesis that this dataset is white noise."
[1] "One of the top 5 models using BIC was an ARMA(0,0), indicating this series may be white noise."
[1] "Both tests for stationarity were inconclusive."

The Ljung-Box test with K=10 has a p-value of 0.0009489966 .The Ljung-Box test with K=24 has a p-value of 0.0002502709 .[1] "Ljung-Box test results: At a significance level of 0.05, we reject the null hypothesis that this dataset is white noise."
[1] "One of the top 5 models using BIC was an ARMA(0,0), indicating this series may be white noise."
[1] "Both tests for stationarity were inconclusive."

The Ljung-Box test with K=10 has a p-value of 0.0186233 .The Ljung-Box test with K=24 has a p-value of 0.005561031 .[1] "Ljung-Box test results: At a significance level of 0.05, we reject the null hypothesis that this dataset is white noise."
[1] "One of the top 5 models using BIC was an ARMA(0,0), indicating this series may be white noise."
[1] "Both tests for stationarity were inconclusive."

The Ljung-Box test with K=10 has a p-value of 6.426664e-08 .The Ljung-Box test with K=24 has a p-value of 6.568032e-10 .[1] "Ljung-Box test results: At a significance level of 0.05, we reject the null hypothesis that this dataset is white noise."
[1] "Both stationarity tests indicate this time series is NOT stationary."

The Ljung-Box test with K=10 has a p-value of 2.934075e-10 .The Ljung-Box test with K=24 has a p-value of 3.874856e-11 .[1] "Ljung-Box test results: At a significance level of 0.05, we reject the null hypothesis that this dataset is white noise."
[1] "Both tests for stationarity were inconclusive."

The Ljung-Box test with K=10 has a p-value of 0.6360152 .The Ljung-Box test with K=24 has a p-value of 0.844331 .[1] "Ljung-Box test results: At a significance level of 0.05, we fail to reject the null hypothesis that this dataset is white noise."
[1] "One of the top 5 models using BIC was an ARMA(0,0), indicating this series may be white noise."
[1] "Both stationarity tests indicate this time series is stationary."

The Ljung-Box test with K=10 has a p-value of 0.06656046 .The Ljung-Box test with K=24 has a p-value of 0.0002436308 .[1] "Ljung-Box test results: At a significance level of 0.05, the test is inconclusive."
[1] "One of the top 5 models using BIC was an ARMA(0,0), indicating this series may be white noise."
[1] "Both tests for stationarity were inconclusive."

The Ljung-Box test with K=10 has a p-value of 0.02684747 .The Ljung-Box test with K=24 has a p-value of 0.00508631 .[1] "Ljung-Box test results: At a significance level of 0.05, we reject the null hypothesis that this dataset is white noise."
[1] "One of the top 5 models using BIC was an ARMA(0,0), indicating this series may be white noise."
[1] "Both tests for stationarity were inconclusive."

Product_Type Product Customer ljung_10 ljung_24 ljung_results top_5_bic ADF PP KPSS stationarity_results EqualMeans_1_ASE EqualMeans_2_ASE EqualMeans_3_ASE EqualMeans_4_ASE EqualMeans_5_ASE EqualMeans_6_ASE EqualMeans_7_ASE EqualMeans_8_ASE EqualMeans_9_ASE EqualMeans_10_ASE EqualMeans_11_ASE EqualMeans_12_ASE ARMA_1_ASE ARMA_2_ASE ARMA_3_ASE ARMA_4_ASE ARMA_5_ASE ARMA_6_ASE ARMA_7_ASE ARMA_8_ASE ARMA_9_ASE ARMA_10_ASE ARMA_11_ASE ARMA_12_ASE ARIMA_1_ASE ARIMA_2_ASE ARIMA_3_ASE ARIMA_4_ASE ARIMA_5_ASE ARIMA_6_ASE ARIMA_7_ASE ARIMA_8_ASE ARIMA_9_ASE ARIMA_10_ASE ARIMA_11_ASE ARIMA_12_ASE ARIMA_S12_1_ASE ARIMA_S12_2_ASE ARIMA_S12_3_ASE ARIMA_S12_4_ASE ARIMA_S12_5_ASE ARIMA_S12_6_ASE ARIMA_S12_7_ASE ARIMA_S12_8_ASE ARIMA_S12_9_ASE ARIMA_S12_10_ASE ARIMA_S12_11_ASE ARIMA_S12_12_ASE
700005895 JACK DANIELS BLK WHSKY 750M 700005895 4.786171e-12 1.665335e-15 not white noise NA 0.01000000 0.01 0.01000000 inconclusive 9.0689744 9.1510256 9.1886325 9.1215385 9.2110256 9.6625641 9.9165934 10.1410897 10.2612821 10.3625641 10.2468298 10.6138462 5.5392257 5.9681069 6.3616927 6.4042988 6.4227636 6.4027409 6.6372491 6.7007490 6.7862477 6.7964345 6.7325565 6.8699152 8.5418681 9.2801912 8.6697046 9.3972474 9.5739507 9.0672141 9.6068875 9.4353998 9.5065170 9.6750977 9.3342680 9.3124904 9.155954 9.981319 10.046597 10.254467 10.473186 10.450372 10.530208 10.474697 10.512969 10.469637 10.440687 9.977978
700005448 TORTILLA SILVER TEQ DSS 1.75L 700005448 8.807377e-02 3.665865e-01 white noise white noise 0.36870575 0.01 0.04762877 not stationary 0.5716556 0.5655017 0.5624248 0.5890915 0.6004761 0.6090060 0.6144394 0.6163350 0.6305729 0.6623222 0.6920285 0.7245188 0.7207688 0.6861532 0.6757951 0.6679848 0.6538848 0.6548755 0.6565445 0.6579988 0.6676573 0.6958380 0.7219311 0.7529246 0.6405925 0.6299260 0.6164646 0.6233314 0.6240543 0.6366802 0.6364920 0.6307053 0.6530211 0.6699885 0.6931830 0.7184782 2.032046 1.722801 1.651667 1.800139 2.099372 2.177397 2.211459 2.195750 2.284632 2.260631 2.206559 2.181600
701001904 FLOR DE CANA GOLD RUM 4YR 1L 701001904 3.801776e-01 1.126704e-01 white noise white noise 0.01799216 0.01 0.01000000 inconclusive 0.6995513 0.5290385 0.4687821 0.4425000 0.4523718 0.4589530 0.4816026 0.5017949 0.5197792 0.5367308 0.5501340 0.5606624 1.0442915 0.8301104 0.7067074 0.6343535 0.6128546 0.5994945 0.5999598 0.6006017 0.6010513 0.6102566 0.6137591 0.6163443 1.9471137 1.3335527 1.1635218 1.0611714 1.0070012 1.0167857 0.9846006 1.0169535 1.0343591 1.0306570 1.0266886 1.0104301 1.772864 2.322617 2.302087 2.249213 2.201378 2.157702 2.153409 2.092362 2.041340 2.006400 1.978361 1.954473
700005925 CASA NOBLE CRYSTAL TEQ 6PK 750M 700005925 9.489966e-04 2.502709e-04 not white noise white noise 0.56183917 0.01 0.10000000 inconclusive 3.1726068 3.2405556 2.7649145 2.5264530 2.3567094 2.2431197 2.1619841 2.0844658 2.0233191 1.9738889 1.9341453 1.8899145 4.6180807 4.3620508 3.4623764 3.1590933 2.8408239 2.6484569 2.5365775 2.3976202 2.3051311 2.2344015 2.1656202 2.1016788 5.7705099 5.0332742 4.0433952 3.6224390 3.1748973 3.0480544 2.8517410 2.6583122 2.6026693 2.4718678 2.3973343 2.3338023 6.311784 7.842069 8.196566 8.260550 8.124630 8.058478 7.944359 7.942456 7.808970 7.577955 7.185047 6.843732
701001770 PIRAS 51 CACHACA 80 1L 701001770 1.862330e-02 5.561031e-03 not white noise white noise 0.21808191 0.01 0.07405623 inconclusive 0.7631624 0.7772650 0.7768376 0.7029060 0.6354701 0.6046154 0.6243346 0.6400855 0.6620228 0.6680342 0.6624631 0.6627350 0.6446346 0.6657276 0.6525417 0.5925254 0.5308812 0.5020173 0.5298103 0.5568825 0.5879643 0.6020638 0.6045947 0.6120855 0.5001610 0.5698775 0.6161735 0.6000020 0.5748791 0.5755548 0.6115162 0.6488012 0.6920893 0.7273038 0.7643915 0.7972260 2.133433 2.262730 2.385876 2.528330 2.554339 2.586967 2.650574 2.684445 2.731844 2.739532 2.727685 2.665071
701001908 MCCORMICK VODKA 80 1.75L 701001908 6.426664e-08 6.568032e-10 not white noise NA 0.35666834 0.01 0.01740497 not stationary 2.2285256 2.4682692 2.0174145 1.8387821 1.7351923 1.6960470 1.6831044 1.6737179 1.6755342 1.6782692 1.6840035 1.6919872 2.6388001 2.9401760 2.8495561 2.5864904 2.3975025 2.3198086 2.2665143 2.2897757 2.3101477 2.2679359 2.1984358 2.1269990 2.8193328 3.1843995 3.1282574 3.0207945 2.9848679 3.0366704 2.9866854 2.8984773 2.8083638 2.6253766 2.4693641 2.3587800 2.718075 2.731890 2.603679 2.389337 2.253288 2.245274 2.215078 2.217877 2.233337 2.231591 2.235785 2.232764
700005926 MCCORMICK VODKA 80 TRVL 750M 700005926 2.934075e-10 3.874856e-11 not white noise NA 0.07556121 0.01 0.10000000 inconclusive 0.6716239 0.5062393 0.4528205 0.4171368 0.3767521 0.3481197 0.3262027 0.3161752 0.3018234 0.2911111 0.2919037 0.2927778 0.5968163 0.4579625 0.4497181 0.4511265 0.4286348 0.4049576 0.3825204 0.3637018 0.3428458 0.3270631 0.3227980 0.3181758 0.7227470 0.5716485 0.6012171 0.6667377 0.7006763 0.6931936 0.7031823 0.7046800 0.6948582 0.6932306 0.6941748 0.6899631 2.242084 1.956935 2.049454 1.863884 1.727736 1.549117 1.558636 1.507911 1.542104 1.495994 1.398345 1.408520
701001850 RICH & RARE CANADIAN RSV 6PK 750M 701001850 6.360152e-01 8.443310e-01 white noise white noise 0.03437467 0.01 0.10000000 stationary 11.9384353 10.4039481 9.9608284 10.6224737 10.8606404 11.0467686 11.1601569 11.2330186 11.2435663 11.3251840 11.5126614 11.6416917 10.9581620 10.7792516 11.0698208 12.0680550 12.0926064 12.3485626 12.1985500 12.0879789 12.0085145 12.0304265 12.1421225 12.2456236 15.9706679 14.2314006 12.0051347 14.2947521 14.6930887 14.8401812 14.7715397 15.1490428 14.9630577 15.3793237 15.4024611 15.4003271 15.974995 19.457766 19.705139 19.398040 17.880262 17.076971 16.550790 16.126107 15.784831 15.735607 15.589212 15.317253
700005900 1800 SILVER TEQ 750M 700005900 6.656046e-02 2.436308e-04 inconclusive white noise 0.01000000 0.01 0.01000000 inconclusive 1.1171368 1.1107265 1.1102991 1.1081624 1.1017521 1.1201282 1.0706166 1.0338034 1.0060256 0.9840598 0.9670202 0.9756838 1.3180946 1.2112054 1.1772851 1.1584018 1.1419437 1.1536212 1.0993249 1.0589231 1.0283543 1.0041556 0.9852891 0.9924302 1.5081476 1.4503722 1.2940762 1.3000560 1.1782780 1.1161573 1.0581466 1.0076505 0.9827825 0.9540515 0.9299877 0.9175731 1.240651 1.421723 1.520543 1.556107 1.579133 1.557323 1.510084 1.475001 1.447865 1.426175 1.436418 1.425711
701001907 FIREBALL CINN WHSKY NL 1.75L 701001907 2.684747e-02 5.086310e-03 not white noise white noise 0.04668965 0.01 0.01000000 inconclusive 3.4168803 3.3079060 2.9254274 2.7130342 2.5886752 2.5040598 2.4198107 2.3614316 2.3071937 2.2732906 2.2324981 2.2626068 3.7157148 3.4365654 3.1173311 2.9231418 2.8139887 2.7461842 2.6322659 2.5592011 2.4549392 2.3839704 2.3220255 2.3329799 5.8000703 5.1632613 4.7546005 4.5020618 4.4388272 4.0885904 3.9722412 3.9131948 3.7770898 3.7799643 3.7415046 3.8206163 3.409515 4.526630 5.475029 6.034526 5.773231 5.414569 5.320162 5.250294 5.147824 4.962384 4.771355 4.783543

Forecast Aggregation by Product


'data.frame':   2436 obs. of  5 variables:
 $ date        : Factor w/ 84 levels "1/1/2013","1/1/2014",..: 1 29 36 43 50 57 64 71 78 8 ...
 $ Product_Type: Factor w/ 57 levels "ABSINTHE","AMARETTO",..: 49 49 49 49 49 49 49 49 49 49 ...
 $ Product     : Factor w/ 4017 levels "1800 ANEJO TEQ 6PK 750M",..: 2325 2325 2325 2325 2325 2325 2325 2325 2325 2325 ...
 $ Customer_ID : int  700005925 700005925 700005925 700005925 700005925 700005925 700005925 700005925 700005925 700005925 ...
 $ n           : int  84 84 84 84 84 84 84 84 84 84 ...
'data.frame':   2436 obs. of  7 variables:
 $ date        : chr  "1/1/2013" "2/1/2013" "3/1/2013" "4/1/2013" ...
 $ Product_Type: Factor w/ 57 levels "ABSINTHE","AMARETTO",..: 49 49 49 49 49 49 49 49 49 49 ...
 $ Product     : Factor w/ 4017 levels "1800 ANEJO TEQ 6PK 750M",..: 2325 2325 2325 2325 2325 2325 2325 2325 2325 2325 ...
 $ Customer_ID : int  700005925 700005925 700005925 700005925 700005925 700005925 700005925 700005925 700005925 700005925 ...
 $ n           : int  84 84 84 84 84 84 84 84 84 84 ...
 $ STD_Cases   : num  53.8 58 67 68 72 66 72 72 44 49.8 ...
 $ Dollar_Sales: num  3135 3379 3903 3961 4194 ...
'data.frame':   336 obs. of  7 variables:
 $ date        : chr  "1/1/2013" "2/1/2013" "3/1/2013" "4/1/2013" ...
 $ Product_Type: Factor w/ 57 levels "ABSINTHE","AMARETTO",..: 49 49 49 49 49 49 49 49 49 49 ...
 $ Product     : Factor w/ 4017 levels "1800 ANEJO TEQ 6PK 750M",..: 2325 2325 2325 2325 2325 2325 2325 2325 2325 2325 ...
 $ Customer_ID : int  700005895 700005895 700005895 700005895 700005895 700005895 700005895 700005895 700005895 700005895 ...
 $ n           : int  39 39 39 39 39 39 39 39 39 39 ...
 $ STD_Cases   : num  2 0 0 1 1 0 0 0 0 0 ...
 $ Dollar_Sales: num  117 0 0 58 58 0 0 0 0 0 ...
z = nrow(combinations)
results <- data.frame(Product_Type=integer(),
                      Product=character(),
                      Customer=integer(),
                      ljung_10=double(),
                      ljung_24=double(),
                      ljung_results=character(),
                      top_5_bic=character(),
                      ADF=double(),
                      PP=double(),
                      KPSS=double(),
                      stationarity_results=character(),
                      EqualMeans_1_ASE=double(),
                      EqualMeans_2_ASE=double(),
                      EqualMeans_3_ASE=double(),
                      EqualMeans_4_ASE=double(),
                      EqualMeans_5_ASE=double(),
                      EqualMeans_6_ASE=double(),
                      EqualMeans_7_ASE=double(),
                      EqualMeans_8_ASE=double(),
                      EqualMeans_9_ASE=double(),
                      EqualMeans_10_ASE=double(),
                      EqualMeans_11_ASE=double(),
                      EqualMeans_12_ASE=double(),
                      EqualMeans_F1=double(),
                      EqualMeans_F2=double(),
                      EqualMeans_F3=double(),
                      EqualMeans_F4=double(),
                      EqualMeans_F5=double(),
                      EqualMeans_F6=double(),
                      EqualMeans_F7=double(),
                      EqualMeans_F8=double(),
                      EqualMeans_F9=double(),
                      EqualMeans_F10=double(),
                      EqualMeans_F11=double(),
                      EqualMeans_F12=double(),
                      ARMA_1_ASE=double(),
                      ARMA_2_ASE=double(),
                      ARMA_3_ASE=double(),
                      ARMA_4_ASE=double(),
                      ARMA_5_ASE=double(),
                      ARMA_6_ASE=double(),
                      ARMA_7_ASE=double(),
                      ARMA_8_ASE=double(),
                      ARMA_9_ASE=double(),
                      ARMA_10_ASE=double(),
                      ARMA_11_ASE=double(),
                      ARMA_12_ASE=double(),
                      ARMA_F1=double(),
                      ARMA_F2=double(),
                      ARMA_F3=double(),
                      ARMA_F4=double(),
                      ARMA_F5=double(),
                      ARMA_F6=double(),
                      ARMA_F7=double(),
                      ARMA_F8=double(),
                      ARMA_F9=double(),
                      ARMA_F10=double(),
                      ARMA_F11=double(),
                      ARMA_F12=double(),
                      ARIMA_1_ASE=double(),
                      ARIMA_2_ASE=double(),
                      ARIMA_3_ASE=double(),
                      ARIMA_4_ASE=double(),
                      ARIMA_5_ASE=double(),
                      ARIMA_6_ASE=double(),
                      ARIMA_7_ASE=double(),
                      ARIMA_8_ASE=double(),
                      ARIMA_9_ASE=double(),
                      ARIMA_10_ASE=double(),
                      ARIMA_11_ASE=double(),
                      ARIMA_12_ASE=double(),
                      ARIMA_F1=double(),
                      ARIMA_F2=double(),
                      ARIMA_F3=double(),
                      ARIMA_F4=double(),
                      ARIMA_F5=double(),
                      ARIMA_F6=double(),
                      ARIMA_F7=double(),
                      ARIMA_F8=double(),
                      ARIMA_F9=double(),
                      ARIMA_F10=double(),
                      ARIMA_F11=double(),
                      ARIMA_F12=double(),
                      ARIMA_S12_1_ASE=double(),
                      ARIMA_S12_2_ASE=double(),
                      ARIMA_S12_3_ASE=double(),
                      ARIMA_S12_4_ASE=double(),
                      ARIMA_S12_5_ASE=double(),
                      ARIMA_S12_6_ASE=double(),
                      ARIMA_S12_7_ASE=double(),
                      ARIMA_S12_8_ASE=double(),
                      ARIMA_S12_9_ASE=double(),
                      ARIMA_S12_10_ASE=double(),
                      ARIMA_S12_11_ASE=double(),
                      ARIMA_S12_12_ASE=double(),
                      ARIMA_S12_F1=double(),
                      ARIMA_S12_F2=double(),
                      ARIMA_S12_F3=double(),
                      ARIMA_S12_F4=double(),
                      ARIMA_S12_F5=double(),
                      ARIMA_S12_F6=double(),
                      ARIMA_S12_F7=double(),
                      ARIMA_S12_F8=double(),
                      ARIMA_S12_F9=double(),
                      ARIMA_S12_F10=double(),
                      ARIMA_S12_F11=double(),
                      ARIMA_S12_F12=double(),
                      ACTUAL_1=double(),
                      ACTUAL_2=double(),
                      ACTUAL_3=double(),
                      ACTUAL_4=double(),
                      ACTUAL_5=double(),
                      ACTUAL_6=double(),
                      ACTUAL_7=double(),
                      ACTUAL_8=double(),
                      ACTUAL_9=double(),
                      ACTUAL_10=double(),
                      ACTUAL_11=double(),
                      ACTUAL_12=double(),
                      stringsAsFactors = FALSE)

# loop through sample combinations
for(i in 1:z) {
  sample_combinations1 = combinations[i,]
  temp1 = inner_join(temp,sample_combinations1)
  product = sample_combinations1$Product
  customer = sample_combinations1$Customer_ID
  product_type = sample_combinations1$Customer_ID
  
  results[i,"Product_Type"] = product_type
  results[i,"Product"] = as.character(sample_combinations1$Product)
  results[i,"Customer"] = customer
  
  par(mfrow=c(1,1))
  plot.ts(temp1$STD_Cases, 
          main=c(paste("Standard Case Sales of ", product), 
                 paste("for Customer",customer)),
          xlab="Months",
          ylab="Standard Cases")
  
  par(mfrow = c(2,2))
  invisible(acf(temp1$STD_Cases, main="ACF"))
  invisible(parzen.wge(temp1$STD_Cases))

  invisible(acf(temp1$STD_Cases[0:length(temp1$date)/2], main="ACF for 1st Half of Series"))
  invisible(acf(temp1$STD_Cases[(1+length(temp1$date)/2):length(temp1$date)], main="ACF for 2nd Half of Series"))
  
  sink("file")
  ljung_10 = ljung.wge(temp1$STD_Cases,K=10)
  sink()
  cat("The Ljung-Box test with K=10 has a p-value of",ljung_10$pval,".")
  results[i,"ljung_10"] = ljung_10$pval
  
  sink("file")
  ljung_24 = ljung.wge(temp1$STD_Cases,K=24)
  sink()
  cat("The Ljung-Box test with K=24 has a p-value of",ljung_24$pval,".")
  results[i,"ljung_24"] = ljung_24$pval
  
  if (ljung_10$pval < .05 & ljung_24$pval < .05){
    print("Ljung-Box test results: At a significance level of 0.05, we reject the null hypothesis that this dataset is white noise.")
    results[i,"ljung_results"] = "not white noise"
  } else if (ljung_10$pval > .05 & ljung_24$pval < .05){
    print("Ljung-Box test results: At a significance level of 0.05, the test is inconclusive.")
    results[i,"ljung_results"] = "inconclusive"
  } else if (ljung_10$pval < .05 & ljung_24$pval > .05){
    print("Ljung-Box test results: At a significance level of 0.05, the test is inconclusive.")
    results[i,"ljung_results"] = "inconclusive"
  } else {
    print("Ljung-Box test results: At a significance level of 0.05, we fail to reject the null hypothesis that this dataset is white noise.")
    results[i,"ljung_results"] = "white noise"
  }
  
  sink("file")
  aic = invisible(aic5.wge(temp1$STD_Cases,type="bic"))
  sink()
  
  for (row in 1:nrow(aic)) {
    if(aic[row,1] == 0 & aic[row,2] == 0){
      print("One of the top 5 models using BIC was an ARMA(0,0), indicating this series may be white noise.")
      results[i,"top_5_bic"] = "white noise"
    }
  }
  
  # Tests for stationarity
  
  # Augmented Dickey-Fuller
  adf=tseries::adf.test(temp1$STD_Cases)
  results[i,"ADF"] = adf$p.value
  
  # Phillips-Perron
  pp=tseries::pp.test(temp1$STD_Cases)
  results[i,"PP"] = pp$p.value
  
  # Kwiatkowski-Phillips-Schmidt-Shin
  kpss=tseries::kpss.test(temp1$STD_Cases)
  results[i,"KPSS"] = kpss$p.value
  
  if (adf$p.value < .05 &  kpss$p.value > .05){
    print("Both stationarity tests indicate this time series is stationary.")
    results[i,"stationarity_results"] = "stationary"
  } else if (adf$p.value >= .05 & kpss$p.value <= .05){
    print("Both stationarity tests indicate this time series is NOT stationary.")
    results[i,"stationarity_results"] = "not stationary"
  } else {
    print("Both tests for stationarity were inconclusive.")
    results[i,"stationarity_results"] = "inconclusive"
  }
  
  j=12
  
  #Equal Means Model
  
  trainingSize = 60
  ASEHolder1 = numeric()
  ASEHolder2 = numeric()
  ASEHolder3 = numeric()
  ASEHolder4 = numeric()
  ASEHolder5 = numeric()
  ASEHolder6 = numeric()
  ASEHolder7 = numeric()
  ASEHolder8 = numeric()
  ASEHolder9 = numeric()
  ASEHolder10 = numeric()
  ASEHolder11 = numeric()
  ASEHolder12 = numeric()

  for( k in 1:(84-(trainingSize + j) + 1))
  {
    sink("file")
    model0_mean = mean(temp1$STD_Cases[k:(k+(trainingSize-1))])
    ASEHolder1[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 1 - 1)] - model0_mean)^2)
    ASEHolder2[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 2 - 1)] - model0_mean)^2)
    ASEHolder3[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 3 - 1)] - model0_mean)^2)
    ASEHolder4[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 4 - 1)] - model0_mean)^2)
    ASEHolder5[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 5 - 1)] - model0_mean)^2)
    ASEHolder6[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 6 - 1)] - model0_mean)^2)
    ASEHolder7[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 7 - 1)] - model0_mean)^2)
    ASEHolder8[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 8 - 1)] - model0_mean)^2)
    ASEHolder9[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 9 - 1)] - model0_mean)^2)
    ASEHolder10[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 10 - 1)] - model0_mean)^2)
    ASEHolder11[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 11 - 1)] - model0_mean)^2)
    ASEHolder12[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 12 - 1)] - model0_mean)^2)
    
    sink()
    
    assign(paste("EqualMeans_Results_",k,sep=""),(temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + j - 1)] - model0_mean)^2)
  }
  
  WindowedASE1 = mean(ASEHolder1)
  WindowedASE2 = mean(ASEHolder2)
  WindowedASE3 = mean(ASEHolder3)
  WindowedASE4 = mean(ASEHolder4)
  WindowedASE5 = mean(ASEHolder5)
  WindowedASE6 = mean(ASEHolder6)
  WindowedASE7 = mean(ASEHolder7)
  WindowedASE8 = mean(ASEHolder8)
  WindowedASE9 = mean(ASEHolder9)
  WindowedASE10 = mean(ASEHolder10)
  WindowedASE11 = mean(ASEHolder11)
  WindowedASE12 = mean(ASEHolder12)
  results[i,paste0("EqualMeans_1_ASE")] = WindowedASE1
  results[i,paste0("EqualMeans_2_ASE")] = WindowedASE2
  results[i,paste0("EqualMeans_3_ASE")] = WindowedASE3
  results[i,paste0("EqualMeans_4_ASE")] = WindowedASE4
  results[i,paste0("EqualMeans_5_ASE")] = WindowedASE5
  results[i,paste0("EqualMeans_6_ASE")] = WindowedASE6
  results[i,paste0("EqualMeans_7_ASE")] = WindowedASE7
  results[i,paste0("EqualMeans_8_ASE")] = WindowedASE8
  results[i,paste0("EqualMeans_9_ASE")] = WindowedASE9
  results[i,paste0("EqualMeans_10_ASE")] = WindowedASE10
  results[i,paste0("EqualMeans_11_ASE")] = WindowedASE11
  results[i,paste0("EqualMeans_12_ASE")] = WindowedASE12
  
  results[i,paste0("EqualMeans_F1")] = model0_mean  
  results[i,paste0("EqualMeans_F2")] = model0_mean  
  results[i,paste0("EqualMeans_F3")] = model0_mean  
  results[i,paste0("EqualMeans_F4")] = model0_mean  
  results[i,paste0("EqualMeans_F5")] = model0_mean  
  results[i,paste0("EqualMeans_F6")] = model0_mean  
  results[i,paste0("EqualMeans_F7")] = model0_mean  
  results[i,paste0("EqualMeans_F8")] = model0_mean  
  results[i,paste0("EqualMeans_F9")] = model0_mean  
  results[i,paste0("EqualMeans_F10")] = model0_mean  
  results[i,paste0("EqualMeans_F11")] = model0_mean  
  results[i,paste0("EqualMeans_F12")] = model0_mean  
  

  #ARMA Model
  
  trainingSize = 60
  ASEHolder1 = numeric()
  ASEHolder2 = numeric()
  ASEHolder3 = numeric()
  ASEHolder4 = numeric()
  ASEHolder5 = numeric()
  ASEHolder6 = numeric()
  ASEHolder7 = numeric()
  ASEHolder8 = numeric()
  ASEHolder9 = numeric()
  ASEHolder10 = numeric()
  ASEHolder11 = numeric()
  ASEHolder12 = numeric()
  
  for( k in 1:(84-(trainingSize + j) + 1))
  {
    sink("file")
    model1 = invisible(aic.wge(temp1$STD_Cases[k:(k+(trainingSize-1))],type="aic"))
    model1_est = invisible(est.arma.wge(temp1$STD_Cases[k:(k+(trainingSize-1))],p=model1$p,q=model1$q))
    forecasts = fore.aruma.wge(temp1$STD_Cases[k:(k+(trainingSize-1))],phi = model1_est$phi, theta = model1_est$theta, s = 0, d = 0,n.ahead = j,plot=FALSE)

    ASEHolder1[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 1 - 1)] - forecasts$f[1:1])^2)
    ASEHolder2[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 2 - 1)] - forecasts$f[1:2])^2)
    ASEHolder3[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 3 - 1)] - forecasts$f[1:3])^2)
    ASEHolder4[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 4 - 1)] - forecasts$f[1:4])^2)
    ASEHolder5[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 5 - 1)] - forecasts$f[1:5])^2)
    ASEHolder6[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 6 - 1)] - forecasts$f[1:6])^2)
    ASEHolder7[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 7 - 1)] - forecasts$f[1:7])^2)
    ASEHolder8[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 8 - 1)] - forecasts$f[1:8])^2)
    ASEHolder9[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 9 - 1)] - forecasts$f[1:9])^2)
    ASEHolder10[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 10 - 1)] - forecasts$f[1:10])^2)
    ASEHolder11[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 11 - 1)] - forecasts$f[1:11])^2)
    ASEHolder12[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 12 - 1)] - forecasts$f[1:12])^2)
    
    sink()
    
    assign(paste("ARMA_Results_",k,sep=""),(temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + j - 1)] - forecasts$f)^2)

  }
  
  WindowedASE1 = mean(ASEHolder1)
  WindowedASE2 = mean(ASEHolder2)
  WindowedASE3 = mean(ASEHolder3)
  WindowedASE4 = mean(ASEHolder4)
  WindowedASE5 = mean(ASEHolder5)
  WindowedASE6 = mean(ASEHolder6)
  WindowedASE7 = mean(ASEHolder7)
  WindowedASE8 = mean(ASEHolder8)
  WindowedASE9 = mean(ASEHolder9)
  WindowedASE10 = mean(ASEHolder10)
  WindowedASE11 = mean(ASEHolder11)
  WindowedASE12 = mean(ASEHolder12)
  results[i,paste0("ARMA_1_ASE")] = WindowedASE1
  results[i,paste0("ARMA_2_ASE")] = WindowedASE2
  results[i,paste0("ARMA_3_ASE")] = WindowedASE3
  results[i,paste0("ARMA_4_ASE")] = WindowedASE4
  results[i,paste0("ARMA_5_ASE")] = WindowedASE5
  results[i,paste0("ARMA_6_ASE")] = WindowedASE6
  results[i,paste0("ARMA_7_ASE")] = WindowedASE7
  results[i,paste0("ARMA_8_ASE")] = WindowedASE8
  results[i,paste0("ARMA_9_ASE")] = WindowedASE9
  results[i,paste0("ARMA_10_ASE")] = WindowedASE10
  results[i,paste0("ARMA_11_ASE")] = WindowedASE11
  results[i,paste0("ARMA_12_ASE")] = WindowedASE12
  
  results[i,paste0("ARMA_F1")] = forecasts$f[1]  
  results[i,paste0("ARMA_F2")] = forecasts$f[2]   
  results[i,paste0("ARMA_F3")] = forecasts$f[3]   
  results[i,paste0("ARMA_F4")] = forecasts$f[4]   
  results[i,paste0("ARMA_F5")] = forecasts$f[5]   
  results[i,paste0("ARMA_F6")] = forecasts$f[6]   
  results[i,paste0("ARMA_F7")] = forecasts$f[7]   
  results[i,paste0("ARMA_F8")] = forecasts$f[8]   
  results[i,paste0("ARMA_F9")] = forecasts$f[9]   
  results[i,paste0("ARMA_F10")] = forecasts$f[10]   
  results[i,paste0("ARMA_F11")] = forecasts$f[11]   
  results[i,paste0("ARMA_F12")] = forecasts$f[12]   
  
  #ARIMA Model with d=1
  nulldev()
  temp2 = artrans.wge(temp1$STD_Cases,1)
  dev.off()
  
  trainingSize = 60
  ASEHolder1 = numeric()
  ASEHolder2 = numeric()
  ASEHolder3 = numeric()
  ASEHolder4 = numeric()
  ASEHolder5 = numeric()
  ASEHolder6 = numeric()
  ASEHolder7 = numeric()
  ASEHolder8 = numeric()
  ASEHolder9 = numeric()
  ASEHolder10 = numeric()
  ASEHolder11 = numeric()
  ASEHolder12 = numeric()
    
  for( k in 1:(84-(trainingSize + j) + 1))
  {
    sink("file")
    model1 = invisible(aic.wge(temp2[k:(k+(trainingSize-1-1))],type="aic"))
    model1_est = invisible(est.arma.wge(temp2[k:(k+(trainingSize-1-1))],p=model1$p,q=model1$q))
    forecasts = fore.aruma.wge(temp1$STD_Cases[k:(k+(trainingSize-1))],phi = model1_est$phi, theta = model1_est$theta, s = 0, d = 1,n.ahead = j,plot=FALSE)
    ASEHolder1[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 1 - 1)] - forecasts$f[1:1])^2)
    ASEHolder2[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 2 - 1)] - forecasts$f[1:2])^2)
    ASEHolder3[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 3 - 1)] - forecasts$f[1:3])^2)
    ASEHolder4[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 4 - 1)] - forecasts$f[1:4])^2)
    ASEHolder5[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 5 - 1)] - forecasts$f[1:5])^2)
    ASEHolder6[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 6 - 1)] - forecasts$f[1:6])^2)
    ASEHolder7[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 7 - 1)] - forecasts$f[1:7])^2)
    ASEHolder8[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 8 - 1)] - forecasts$f[1:8])^2)
    ASEHolder9[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 9 - 1)] - forecasts$f[1:9])^2)
    ASEHolder10[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 10 - 1)] - forecasts$f[1:10])^2)
    ASEHolder11[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 11 - 1)] - forecasts$f[1:11])^2)
    ASEHolder12[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 12 - 1)] - forecasts$f[1:12])^2)
    
    sink()
    
    assign(paste("ARIMA_Results_",k,sep=""),(temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + j - 1)] - forecasts$f)^2)

  }
  
  WindowedASE1 = mean(ASEHolder1)
  WindowedASE2 = mean(ASEHolder2)
  WindowedASE3 = mean(ASEHolder3)
  WindowedASE4 = mean(ASEHolder4)
  WindowedASE5 = mean(ASEHolder5)
  WindowedASE6 = mean(ASEHolder6)
  WindowedASE7 = mean(ASEHolder7)
  WindowedASE8 = mean(ASEHolder8)
  WindowedASE9 = mean(ASEHolder9)
  WindowedASE10 = mean(ASEHolder10)
  WindowedASE11 = mean(ASEHolder11)
  WindowedASE12 = mean(ASEHolder12)
  results[i,paste0("ARIMA_1_ASE")] = WindowedASE1
  results[i,paste0("ARIMA_2_ASE")] = WindowedASE2
  results[i,paste0("ARIMA_3_ASE")] = WindowedASE3
  results[i,paste0("ARIMA_4_ASE")] = WindowedASE4
  results[i,paste0("ARIMA_5_ASE")] = WindowedASE5
  results[i,paste0("ARIMA_6_ASE")] = WindowedASE6
  results[i,paste0("ARIMA_7_ASE")] = WindowedASE7
  results[i,paste0("ARIMA_8_ASE")] = WindowedASE8
  results[i,paste0("ARIMA_9_ASE")] = WindowedASE9
  results[i,paste0("ARIMA_10_ASE")] = WindowedASE10
  results[i,paste0("ARIMA_11_ASE")] = WindowedASE11
  results[i,paste0("ARIMA_12_ASE")] = WindowedASE12
  
  results[i,paste0("ARIMA_F1")] = forecasts$f[1]  
  results[i,paste0("ARIMA_F2")] = forecasts$f[2]   
  results[i,paste0("ARIMA_F3")] = forecasts$f[3]   
  results[i,paste0("ARIMA_F4")] = forecasts$f[4]   
  results[i,paste0("ARIMA_F5")] = forecasts$f[5]   
  results[i,paste0("ARIMA_F6")] = forecasts$f[6]   
  results[i,paste0("ARIMA_F7")] = forecasts$f[7]   
  results[i,paste0("ARIMA_F8")] = forecasts$f[8]   
  results[i,paste0("ARIMA_F9")] = forecasts$f[9]   
  results[i,paste0("ARIMA_F10")] = forecasts$f[10]   
  results[i,paste0("ARIMA_F11")] = forecasts$f[11]   
  results[i,paste0("ARIMA_F12")] = forecasts$f[12] 
  
  
  #ARIMA Model with S=12
  nulldev()
  temp2 = artrans.wge(temp1$STD_Cases,phi.tr=c(rep(0,11),1))
  dev.off()
  
  trainingSize = 60
  ASEHolder1 = numeric()
  ASEHolder2 = numeric()
  ASEHolder3 = numeric()
  ASEHolder4 = numeric()
  ASEHolder5 = numeric()
  ASEHolder6 = numeric()
  ASEHolder7 = numeric()
  ASEHolder8 = numeric()
  ASEHolder9 = numeric()
  ASEHolder10 = numeric()
  ASEHolder11 = numeric()
  ASEHolder12 = numeric()
  
  for( k in 1:(84-(trainingSize + j) + 1))
  {
    sink("file")
    model1 = invisible(aic.wge(temp2[k:(k+(trainingSize-1-12))],type="aic"))
    model1_est = invisible(est.arma.wge(temp2[k:(k+(trainingSize-1-12))],p=model1$p,q=model1$q))
    forecasts = fore.aruma.wge(temp1$STD_Cases[k:(k+(trainingSize-1))],phi = model1_est$phi, theta = model1_est$theta, s = 12, d = 0,n.ahead = j,plot=FALSE)
    ASEHolder1[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 1 - 1)] - forecasts$f[1:1])^2)
    ASEHolder2[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 2 - 1)] - forecasts$f[1:2])^2)
    ASEHolder3[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 3 - 1)] - forecasts$f[1:3])^2)
    ASEHolder4[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 4 - 1)] - forecasts$f[1:4])^2)
    ASEHolder5[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 5 - 1)] - forecasts$f[1:5])^2)
    ASEHolder6[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 6 - 1)] - forecasts$f[1:6])^2)
    ASEHolder7[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 7 - 1)] - forecasts$f[1:7])^2)
    ASEHolder8[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 8 - 1)] - forecasts$f[1:8])^2)
    ASEHolder9[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 9 - 1)] - forecasts$f[1:9])^2)
    ASEHolder10[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 10 - 1)] - forecasts$f[1:10])^2)
    ASEHolder11[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 11 - 1)] - forecasts$f[1:11])^2)
    ASEHolder12[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 12 - 1)] - forecasts$f[1:12])^2)
    
    sink()
    
    assign(paste("ARIMAS_Results_",k,sep=""),(temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + j - 1)] - forecasts$f)^2)

  }
  
  WindowedASE1 = mean(ASEHolder1)
  WindowedASE2 = mean(ASEHolder2)
  WindowedASE3 = mean(ASEHolder3)
  WindowedASE4 = mean(ASEHolder4)
  WindowedASE5 = mean(ASEHolder5)
  WindowedASE6 = mean(ASEHolder6)
  WindowedASE7 = mean(ASEHolder7)
  WindowedASE8 = mean(ASEHolder8)
  WindowedASE9 = mean(ASEHolder9)
  WindowedASE10 = mean(ASEHolder10)
  WindowedASE11 = mean(ASEHolder11)
  WindowedASE12 = mean(ASEHolder12)
  results[i,paste0("ARIMA_S12_1_ASE")] = WindowedASE1
  results[i,paste0("ARIMA_S12_2_ASE")] = WindowedASE2
  results[i,paste0("ARIMA_S12_3_ASE")] = WindowedASE3
  results[i,paste0("ARIMA_S12_4_ASE")] = WindowedASE4
  results[i,paste0("ARIMA_S12_5_ASE")] = WindowedASE5
  results[i,paste0("ARIMA_S12_6_ASE")] = WindowedASE6
  results[i,paste0("ARIMA_S12_7_ASE")] = WindowedASE7
  results[i,paste0("ARIMA_S12_8_ASE")] = WindowedASE8
  results[i,paste0("ARIMA_S12_9_ASE")] = WindowedASE9
  results[i,paste0("ARIMA_S12_10_ASE")] = WindowedASE10
  results[i,paste0("ARIMA_S12_11_ASE")] = WindowedASE11
  results[i,paste0("ARIMA_S12_12_ASE")] = WindowedASE12

  results[i,paste0("ARIMA_S12_F1")] = forecasts$f[1]  
  results[i,paste0("ARIMA_S12_F2")] = forecasts$f[2]   
  results[i,paste0("ARIMA_S12_F3")] = forecasts$f[3]   
  results[i,paste0("ARIMA_S12_F4")] = forecasts$f[4]   
  results[i,paste0("ARIMA_S12_F5")] = forecasts$f[5]   
  results[i,paste0("ARIMA_S12_F6")] = forecasts$f[6]   
  results[i,paste0("ARIMA_S12_F7")] = forecasts$f[7]   
  results[i,paste0("ARIMA_S12_F8")] = forecasts$f[8]   
  results[i,paste0("ARIMA_S12_F9")] = forecasts$f[9]   
  results[i,paste0("ARIMA_S12_F10")] = forecasts$f[10]   
  results[i,paste0("ARIMA_S12_F11")] = forecasts$f[11]   
  results[i,paste0("ARIMA_S12_F12")] = forecasts$f[12]   
  
  
  results[i,paste0("ACTUAL_1")] = temp1$STD_Cases[73]
  results[i,paste0("ACTUAL_2")] = temp1$STD_Cases[74]
  results[i,paste0("ACTUAL_3")] = temp1$STD_Cases[75]
  results[i,paste0("ACTUAL_4")] = temp1$STD_Cases[76]
  results[i,paste0("ACTUAL_5")] = temp1$STD_Cases[77]
  results[i,paste0("ACTUAL_6")] = temp1$STD_Cases[78]
  results[i,paste0("ACTUAL_7")] = temp1$STD_Cases[79]
  results[i,paste0("ACTUAL_8")] = temp1$STD_Cases[80]
  results[i,paste0("ACTUAL_9")] = temp1$STD_Cases[81]
  results[i,paste0("ACTUAL_10")] = temp1$STD_Cases[82]
  results[i,paste0("ACTUAL_11")] = temp1$STD_Cases[83]
  results[i,paste0("ACTUAL_12")] = temp1$STD_Cases[84]
  
  #graph ASEs for each Model
  EqualMeans_Results <- rbind(EqualMeans_Results_1,EqualMeans_Results_2,EqualMeans_Results_3,EqualMeans_Results_4,EqualMeans_Results_5,EqualMeans_Results_6,
                              EqualMeans_Results_7,EqualMeans_Results_8,EqualMeans_Results_9,EqualMeans_Results_10,EqualMeans_Results_11,EqualMeans_Results_12,
                              EqualMeans_Results_13)
  
  ARMA_Results <- rbind(ARMA_Results_1,ARMA_Results_2,ARMA_Results_3,ARMA_Results_4,ARMA_Results_5,ARMA_Results_6,ARMA_Results_7,ARMA_Results_8,
                       ARMA_Results_9,ARMA_Results_10,ARMA_Results_11,ARMA_Results_12,ARMA_Results_13)

  ARIMA_Results <- rbind(ARIMA_Results_1,ARIMA_Results_2,ARIMA_Results_3,ARIMA_Results_4,ARIMA_Results_5,ARIMA_Results_6,ARIMA_Results_7,ARIMA_Results_8,
                         ARIMA_Results_9,ARIMA_Results_10,ARIMA_Results_11,ARIMA_Results_12,ARIMA_Results_13)
      
  ARIMAS_Results <- rbind(ARIMAS_Results_1,ARIMAS_Results_2,ARIMAS_Results_3,ARIMAS_Results_4,ARIMAS_Results_5,ARIMAS_Results_6,ARIMAS_Results_7,ARIMAS_Results_8,
                          ARIMAS_Results_9,ARIMAS_Results_10,ARIMAS_Results_11,ARIMAS_Results_12,ARIMAS_Results_13)
      
  EqualMeans_Means <- colMeans(EqualMeans_Results)
  ARMA_Means <- colMeans(ARMA_Results)
  ARIMA_Means <- colMeans(ARIMA_Results)
  ARIMAS_Means <- colMeans(ARIMAS_Results)
  Combined_Means <- data.frame(EqualMeans_Means,ARMA_Means, ARIMA_Means, ARIMAS_Means)
  Combined_Means$horizon <- as.numeric(row.names(Combined_Means))
  

  g <- ggplot(data=Combined_Means, aes(horizon)) +
    geom_line(aes(y=EqualMeans_Means, color="Equal Means"),size=1.5) +
    geom_line(aes(y=ARMA_Means, color="ARMA"),size=1.5) +
    geom_line(aes(y=ARIMA_Means, color="ARIMA"),size=1.5) +
    geom_line(aes(y=ARIMAS_Means, color="ARIMAS"),size=1.5) +
    scale_color_manual(values = c(
      'Equal Means' = '#58508d',
      'ARMA' = '#bc5090',
      'ARIMA' = '#ff6361',
      'ARIMAS' = '#ffa600'
    )) +
    labs(color='Models') +
    scale_x_continuous(breaks=seq(0,13,1)) +
    ggtitle(paste("Model ASEs for ", product,"and Customer",customer)) +
    xlab("Month Ahead Forecast") +
    ylab("ASE") +
    theme(panel.background = element_blank(), axis.line = element_line(colour = "black"), legend.title = element_blank())
  
  print(g)
}

The Ljung-Box test with K=10 has a p-value of 0.002322024 .The Ljung-Box test with K=24 has a p-value of 0.0034262 .[1] "Ljung-Box test results: At a significance level of 0.05, we reject the null hypothesis that this dataset is white noise."
[1] "One of the top 5 models using BIC was an ARMA(0,0), indicating this series may be white noise."
[1] "Both tests for stationarity were inconclusive."

The Ljung-Box test with K=10 has a p-value of 0.007674533 .The Ljung-Box test with K=24 has a p-value of 0 .[1] "Ljung-Box test results: At a significance level of 0.05, we reject the null hypothesis that this dataset is white noise."
[1] "One of the top 5 models using BIC was an ARMA(0,0), indicating this series may be white noise."
[1] "Both stationarity tests indicate this time series is stationary."

The Ljung-Box test with K=10 has a p-value of 1.18705e-12 .The Ljung-Box test with K=24 has a p-value of 1.573741e-12 .[1] "Ljung-Box test results: At a significance level of 0.05, we reject the null hypothesis that this dataset is white noise."
[1] "Both stationarity tests indicate this time series is NOT stationary."

The Ljung-Box test with K=10 has a p-value of 0.006130321 .The Ljung-Box test with K=24 has a p-value of 0.03101856 .[1] "Ljung-Box test results: At a significance level of 0.05, we reject the null hypothesis that this dataset is white noise."
[1] "Both tests for stationarity were inconclusive."

The Ljung-Box test with K=10 has a p-value of 0.2367016 .The Ljung-Box test with K=24 has a p-value of 0.122692 .[1] "Ljung-Box test results: At a significance level of 0.05, we fail to reject the null hypothesis that this dataset is white noise."
[1] "One of the top 5 models using BIC was an ARMA(0,0), indicating this series may be white noise."
[1] "Both stationarity tests indicate this time series is stationary."

The Ljung-Box test with K=10 has a p-value of 9.303002e-10 .The Ljung-Box test with K=24 has a p-value of 1.985955e-07 .[1] "Ljung-Box test results: At a significance level of 0.05, we reject the null hypothesis that this dataset is white noise."
[1] "Both stationarity tests indicate this time series is NOT stationary."

The Ljung-Box test with K=10 has a p-value of 0.004701657 .The Ljung-Box test with K=24 has a p-value of 0.232411 .[1] "Ljung-Box test results: At a significance level of 0.05, the test is inconclusive."
[1] "One of the top 5 models using BIC was an ARMA(0,0), indicating this series may be white noise."
[1] "Both tests for stationarity were inconclusive."

The Ljung-Box test with K=10 has a p-value of 0 .The Ljung-Box test with K=24 has a p-value of 0 .[1] "Ljung-Box test results: At a significance level of 0.05, we reject the null hypothesis that this dataset is white noise."
[1] "Both stationarity tests indicate this time series is NOT stationary."

The Ljung-Box test with K=10 has a p-value of 0.02343884 .The Ljung-Box test with K=24 has a p-value of 0.1671774 .[1] "Ljung-Box test results: At a significance level of 0.05, the test is inconclusive."
[1] "One of the top 5 models using BIC was an ARMA(0,0), indicating this series may be white noise."
[1] "Both stationarity tests indicate this time series is NOT stationary."

The Ljung-Box test with K=10 has a p-value of 0 .The Ljung-Box test with K=24 has a p-value of 0 .[1] "Ljung-Box test results: At a significance level of 0.05, we reject the null hypothesis that this dataset is white noise."
[1] "Both tests for stationarity were inconclusive."

The Ljung-Box test with K=10 has a p-value of 0.7619964 .The Ljung-Box test with K=24 has a p-value of 0.5395173 .[1] "Ljung-Box test results: At a significance level of 0.05, we fail to reject the null hypothesis that this dataset is white noise."
[1] "One of the top 5 models using BIC was an ARMA(0,0), indicating this series may be white noise."
[1] "Both tests for stationarity were inconclusive."

The Ljung-Box test with K=10 has a p-value of 3.036074e-07 .The Ljung-Box test with K=24 has a p-value of 1.098736e-05 .[1] "Ljung-Box test results: At a significance level of 0.05, we reject the null hypothesis that this dataset is white noise."
[1] "Both tests for stationarity were inconclusive."

The Ljung-Box test with K=10 has a p-value of 0.1572929 .The Ljung-Box test with K=24 has a p-value of 0.3914269 .[1] "Ljung-Box test results: At a significance level of 0.05, we fail to reject the null hypothesis that this dataset is white noise."
[1] "One of the top 5 models using BIC was an ARMA(0,0), indicating this series may be white noise."
[1] "Both tests for stationarity were inconclusive."

The Ljung-Box test with K=10 has a p-value of 0 .The Ljung-Box test with K=24 has a p-value of 0 .[1] "Ljung-Box test results: At a significance level of 0.05, we reject the null hypothesis that this dataset is white noise."
[1] "Both stationarity tests indicate this time series is NOT stationary."

The Ljung-Box test with K=10 has a p-value of 0 .The Ljung-Box test with K=24 has a p-value of 0 .[1] "Ljung-Box test results: At a significance level of 0.05, we reject the null hypothesis that this dataset is white noise."
[1] "Both stationarity tests indicate this time series is NOT stationary."

The Ljung-Box test with K=10 has a p-value of 0.3857241 .The Ljung-Box test with K=24 has a p-value of 0.7674317 .[1] "Ljung-Box test results: At a significance level of 0.05, we fail to reject the null hypothesis that this dataset is white noise."
[1] "One of the top 5 models using BIC was an ARMA(0,0), indicating this series may be white noise."
[1] "Both tests for stationarity were inconclusive."

The Ljung-Box test with K=10 has a p-value of 2.798171e-05 .The Ljung-Box test with K=24 has a p-value of 0.0008768368 .[1] "Ljung-Box test results: At a significance level of 0.05, we reject the null hypothesis that this dataset is white noise."
[1] "Both stationarity tests indicate this time series is NOT stationary."

The Ljung-Box test with K=10 has a p-value of 3.111778e-09 .The Ljung-Box test with K=24 has a p-value of 1.111885e-09 .[1] "Ljung-Box test results: At a significance level of 0.05, we reject the null hypothesis that this dataset is white noise."
[1] "Both tests for stationarity were inconclusive."

The Ljung-Box test with K=10 has a p-value of 6.819545e-12 .The Ljung-Box test with K=24 has a p-value of 7.58651e-10 .[1] "Ljung-Box test results: At a significance level of 0.05, we reject the null hypothesis that this dataset is white noise."
[1] "Both stationarity tests indicate this time series is NOT stationary."

The Ljung-Box test with K=10 has a p-value of 9.048454e-08 .The Ljung-Box test with K=24 has a p-value of 5.283449e-07 .[1] "Ljung-Box test results: At a significance level of 0.05, we reject the null hypothesis that this dataset is white noise."
[1] "Both stationarity tests indicate this time series is NOT stationary."

The Ljung-Box test with K=10 has a p-value of 0.0009021729 .The Ljung-Box test with K=24 has a p-value of 0.01759268 .[1] "Ljung-Box test results: At a significance level of 0.05, we reject the null hypothesis that this dataset is white noise."
[1] "Both stationarity tests indicate this time series is stationary."

The Ljung-Box test with K=10 has a p-value of 0 .The Ljung-Box test with K=24 has a p-value of 1.110223e-16 .[1] "Ljung-Box test results: At a significance level of 0.05, we reject the null hypothesis that this dataset is white noise."
[1] "Both stationarity tests indicate this time series is NOT stationary."

The Ljung-Box test with K=10 has a p-value of 0 .The Ljung-Box test with K=24 has a p-value of 0 .[1] "Ljung-Box test results: At a significance level of 0.05, we reject the null hypothesis that this dataset is white noise."
[1] "Both stationarity tests indicate this time series is NOT stationary."

The Ljung-Box test with K=10 has a p-value of 0.0739774 .The Ljung-Box test with K=24 has a p-value of 0.1020833 .[1] "Ljung-Box test results: At a significance level of 0.05, we fail to reject the null hypothesis that this dataset is white noise."
[1] "One of the top 5 models using BIC was an ARMA(0,0), indicating this series may be white noise."
[1] "Both stationarity tests indicate this time series is stationary."

The Ljung-Box test with K=10 has a p-value of 0 .The Ljung-Box test with K=24 has a p-value of 0 .[1] "Ljung-Box test results: At a significance level of 0.05, we reject the null hypothesis that this dataset is white noise."
[1] "Both tests for stationarity were inconclusive."

The Ljung-Box test with K=10 has a p-value of 0.1224362 .The Ljung-Box test with K=24 has a p-value of 0.4792812 .[1] "Ljung-Box test results: At a significance level of 0.05, we fail to reject the null hypothesis that this dataset is white noise."
[1] "One of the top 5 models using BIC was an ARMA(0,0), indicating this series may be white noise."
[1] "Both stationarity tests indicate this time series is NOT stationary."

The Ljung-Box test with K=10 has a p-value of 0 .The Ljung-Box test with K=24 has a p-value of 0 .[1] "Ljung-Box test results: At a significance level of 0.05, we reject the null hypothesis that this dataset is white noise."
[1] "Both tests for stationarity were inconclusive."

The Ljung-Box test with K=10 has a p-value of 0 .The Ljung-Box test with K=24 has a p-value of 0 .[1] "Ljung-Box test results: At a significance level of 0.05, we reject the null hypothesis that this dataset is white noise."
[1] "Both tests for stationarity were inconclusive."

The Ljung-Box test with K=10 has a p-value of 0.1225766 .The Ljung-Box test with K=24 has a p-value of 0.5601297 .[1] "Ljung-Box test results: At a significance level of 0.05, we fail to reject the null hypothesis that this dataset is white noise."
[1] "One of the top 5 models using BIC was an ARMA(0,0), indicating this series may be white noise."
[1] "Both stationarity tests indicate this time series is NOT stationary."

Product_Type Product Customer ljung_10 ljung_24 ljung_results top_5_bic ADF PP KPSS stationarity_results EqualMeans_1_ASE EqualMeans_2_ASE EqualMeans_3_ASE EqualMeans_4_ASE EqualMeans_5_ASE EqualMeans_6_ASE EqualMeans_7_ASE EqualMeans_8_ASE EqualMeans_9_ASE EqualMeans_10_ASE EqualMeans_11_ASE EqualMeans_12_ASE EqualMeans_F1 EqualMeans_F2 EqualMeans_F3 EqualMeans_F4 EqualMeans_F5 EqualMeans_F6 EqualMeans_F7 EqualMeans_F8 EqualMeans_F9 EqualMeans_F10 EqualMeans_F11 EqualMeans_F12 ARMA_1_ASE ARMA_2_ASE ARMA_3_ASE ARMA_4_ASE ARMA_5_ASE ARMA_6_ASE ARMA_7_ASE ARMA_8_ASE ARMA_9_ASE ARMA_10_ASE ARMA_11_ASE ARMA_12_ASE ARMA_F1 ARMA_F2 ARMA_F3 ARMA_F4 ARMA_F5 ARMA_F6 ARMA_F7 ARMA_F8 ARMA_F9 ARMA_F10 ARMA_F11 ARMA_F12 ARIMA_1_ASE ARIMA_2_ASE ARIMA_3_ASE ARIMA_4_ASE ARIMA_5_ASE ARIMA_6_ASE ARIMA_7_ASE ARIMA_8_ASE ARIMA_9_ASE ARIMA_10_ASE ARIMA_11_ASE ARIMA_12_ASE ARIMA_F1 ARIMA_F2 ARIMA_F3 ARIMA_F4 ARIMA_F5 ARIMA_F6 ARIMA_F7 ARIMA_F8 ARIMA_F9 ARIMA_F10 ARIMA_F11 ARIMA_F12 ARIMA_S12_1_ASE ARIMA_S12_2_ASE ARIMA_S12_3_ASE ARIMA_S12_4_ASE ARIMA_S12_5_ASE ARIMA_S12_6_ASE ARIMA_S12_7_ASE ARIMA_S12_8_ASE ARIMA_S12_9_ASE ARIMA_S12_10_ASE ARIMA_S12_11_ASE ARIMA_S12_12_ASE ARIMA_S12_F1 ARIMA_S12_F2 ARIMA_S12_F3 ARIMA_S12_F4 ARIMA_S12_F5 ARIMA_S12_F6 ARIMA_S12_F7 ARIMA_S12_F8 ARIMA_S12_F9 ARIMA_S12_F10 ARIMA_S12_F11 ARIMA_S12_F12 ACTUAL_1 ACTUAL_2 ACTUAL_3 ACTUAL_4 ACTUAL_5 ACTUAL_6 ACTUAL_7 ACTUAL_8 ACTUAL_9 ACTUAL_10 ACTUAL_11 ACTUAL_12 winning_12
700005925 TAAKA VODKA 80 1L 700005925 2.322024e-03 3.426200e-03 not white noise white noise 0.16051598 0.01000000 0.08236679 inconclusive 819.7760806 812.0658241 815.1706105 689.8962088 601.4447370 535.9172216 489.1170549 453.3300453 418.8453911 390.5514370 364.9275910 346.4278690 51.2200000 51.2200000 51.2200000 51.2200000 51.2200000 51.2200000 51.2200000 51.2200000 51.2200000 51.2200000 51.2200000 51.2200000 1220.5831606 1064.5110370 1020.3968276 830.2558671 695.6295191 611.3732866 546.3263424 504.5024731 459.2102364 428.8023578 399.9887614 380.7868738 53.2174811 53.1162966 56.4704512 49.4069529 54.6932876 51.3134915 52.7815933 52.1860505 51.1159264 52.8831414 50.7506623 52.3671199 1.019355e+03 922.8713034 881.9550582 728.1959511 631.0542952 564.5865050 514.4789610 473.0086187 442.0050082 409.5462412 383.0871323 361.6927564 43.2661616 49.3228573 45.0704739 48.2247324 45.8328942 47.6618459 46.2589500 47.3362781 46.5086135 47.1445714 46.6558885 47.0314102 1057.5807655 1102.1703032 1124.8257798 1062.8228638 972.4991512 912.1410119 858.1841098 821.6447126 793.4708438 777.0434603 756.2249502 747.7752374 4.200000e+01 57.0000000 132.0000000 1.400000e+01 7.590000e+01 6.000000e+01 6.800000e+01 79.0000000 41.000000 70.00000000 54.000000 5.300000e+01 60 52.0 67 58 73 57 63.0 64.9 47.0 50 48 29.0 EqualMeans_12_ASE
701000317 TAAKA VODKA 80 1L 701000317 7.674533e-03 0.000000e+00 not white noise white noise 0.01000000 0.01000000 0.10000000 stationary 5386.0238675 5396.0610470 6184.2691667 5551.7975855 5173.2864316 4930.6700214 4762.6696551 4625.7466239 4532.8720157 4471.5482265 4408.0742172 4359.0114744 101.7833333 101.7833333 101.7833333 101.7833333 101.7833333 101.7833333 101.7833333 101.7833333 101.7833333 101.7833333 101.7833333 101.7833333 5075.7624303 5322.5093370 5872.8687369 5059.3211299 4602.3842109 4469.0630501 4407.4131580 4192.1642408 4009.6761962 3890.3554742 3842.3155123 3826.2041051 95.1469980 111.2239452 130.6665597 134.9830893 132.6160184 120.0699014 107.4203227 94.9279002 87.1687948 84.0405840 86.5048168 92.1487011 1.067297e+04 8896.2364736 9681.2959002 7939.4196886 7844.4094248 7990.1810252 8554.5884303 8495.5687722 8648.9829702 8580.5019700 8400.6342571 8098.7569531 100.7928105 106.1108503 104.0874318 98.5400584 96.0526262 95.8392398 96.5603734 97.1166996 97.2837055 97.2210394 97.1236224 97.0748714 8433.3857923 5154.1237411 3763.1088122 2967.9427354 2477.4753201 2186.1939136 1971.8970771 1821.0071934 1703.7337292 1614.6880514 1527.2622155 1454.6370126 6.260246e+01 132.0000000 330.0000000 1.130000e+02 1.060000e+02 1.240000e+02 1.360000e+02 103.0000000 70.000000 25.00000000 47.000000 6.100000e+01 88 125.0 280 136 113 69 139.0 74.0 56.0 50 46 52.0 ARIMA_S12_12_ASE
701001770 TAAKA VODKA 80 1L 701001770 1.187050e-12 1.573741e-12 not white noise NA 0.53188120 0.01000000 0.01000000 not stationary 6037.8142344 6011.6269267 6006.4802173 5164.7525036 4552.7806959 4119.4096190 3804.3090329 3566.8000677 3361.0108897 3202.4520857 3057.9253719 2878.2446917 106.4600000 106.4600000 106.4600000 106.4600000 106.4600000 106.4600000 106.4600000 106.4600000 106.4600000 106.4600000 106.4600000 106.4600000 6069.9661721 5828.9569556 5547.8444068 4610.1606213 3791.3806203 3434.4124271 3067.2728007 2758.3131160 2544.1935701 2414.8295759 2316.1141232 2178.9429165 126.1569793 146.0084226 143.7054915 138.8871720 139.8964381 139.0296243 137.7483457 137.0800734 136.2793895 135.4398483 134.6801564 133.9294398 5.254440e+03 4999.1257339 5154.8823639 4783.7655494 4074.9633382 3593.7634359 3216.2823825 2939.4821732 2754.5828734 2607.4836920 2519.5146881 2417.0835426 130.6083974 149.5099179 167.8357808 158.6284493 146.5277043 151.2585751 159.1897122 156.5399797 151.7689753 152.9420884 155.9654258 155.4518223 6366.8174714 6162.0168690 6965.4999529 6622.7382835 6228.5606941 6005.9191192 5770.7234801 5585.5098089 5469.6374123 5399.0224535 5393.4726932 5417.6119722 1.290000e+02 138.0000000 307.0000000 7.000000e+00 1.550000e+02 1.270000e+02 1.180000e+02 154.0000000 92.000000 148.00000000 192.000000 1.620000e+02 147 117.0 142 133 111 83 95.0 114.0 91.9 104 117 100.0 ARMA_12_ASE
701001790 TAAKA VODKA 80 1L 701001790 6.130321e-03 3.101856e-02 not white noise NA 0.23862134 0.01000000 0.10000000 inconclusive 656.5598284 653.9191489 657.4544780 565.9303476 481.6666900 426.3206618 387.9143779 358.5476137 336.9679082 318.7005028 304.7056093 294.3995806 47.6116667 47.6116667 47.6116667 47.6116667 47.6116667 47.6116667 47.6116667 47.6116667 47.6116667 47.6116667 47.6116667 47.6116667 786.6821475 714.5797864 711.4097381 607.2602509 513.3486510 460.5636041 418.4143139 384.0363764 356.1047069 333.7082767 316.0337581 303.6017446 50.1138106 56.0235607 52.5582075 52.5577752 51.5403314 51.0307437 50.4769171 50.0500161 49.6736841 49.3599313 49.0923578 48.8662770 8.578247e+02 740.6271509 750.6761298 646.1743870 547.8952825 502.9643017 458.7333820 422.7623404 390.8696895 368.0898651 352.1400245 344.3114579 52.6895755 58.3425279 56.6876771 57.1721197 57.0303035 57.0718189 57.0596657 57.0632234 57.0621819 57.0624868 57.0623976 57.0624237 842.6917713 898.1286013 959.1236222 904.9257325 814.4104498 774.4453964 743.4284306 731.9260579 714.1077562 702.2044549 696.7813044 699.6595046 6.789311e+01 55.1070490 119.9267300 6.368655e+00 5.489771e+01 5.193155e+01 5.440356e+01 55.3706734 35.177312 54.14892463 59.076715 7.206030e+01 63 64.9 59 55 52 39 35.0 44.0 32.0 40 33 28.9 EqualMeans_12_ASE
700005448 TAAKA VODKA 80 1L 700005448 2.367016e-01 1.226920e-01 white noise white noise 0.01000000 0.01000000 0.10000000 stationary 3.2606182 3.2721566 3.2434387 3.0333105 2.7925156 2.5995498 2.4645339 2.3359643 2.2364786 2.1533002 2.0775063 2.0241096 2.7483333 2.7483333 2.7483333 2.7483333 2.7483333 2.7483333 2.7483333 2.7483333 2.7483333 2.7483333 2.7483333 2.7483333 3.3155536 3.6951052 3.5728124 3.2893304 2.9938501 2.7727916 2.6125905 2.4612121 2.3474646 2.2538158 2.1690031 2.1081807 2.7483333 2.7483333 2.7483333 2.7483333 2.7483333 2.7483333 2.7483333 2.7483333 2.7483333 2.7483333 2.7483333 2.7483333 4.277557e+00 4.4170716 4.2540623 4.2082053 4.0010940 3.7620384 3.5477853 3.2918129 3.0336648 2.8995667 2.7235312 2.6498099 2.0911105 2.3396315 1.6856053 1.7126542 1.6028931 1.6049587 1.5864818 1.5864097 1.5832898 1.5832066 1.5826781 1.5826521 5.2717011 4.8712880 4.5640162 4.1850058 3.8107385 3.6754518 3.5445104 3.4088147 3.2588620 3.1409703 3.0572035 3.1602990 4.394872e+00 3.5629699 5.9933855 -6.026074e-01 8.879026e-01 3.114198e+00 9.120087e-01 3.1909435 2.023524 3.96196530 4.055599 5.935030e+00 3 4.0 3 2 3 2 1.9 2.0 2.0 3 2 1.0 EqualMeans_12_ASE
700005910 TAAKA VODKA 80 1L 700005910 9.303002e-10 1.985955e-07 not white noise NA 0.41243058 0.01000000 0.01000000 not stationary 6.7172506 6.7250712 6.5282763 5.5460968 4.8189942 4.3354985 3.8306572 3.4450071 3.1375640 2.8975071 2.7124721 2.5533618 3.5983333 3.5983333 3.5983333 3.5983333 3.5983333 3.5983333 3.5983333 3.5983333 3.5983333 3.5983333 3.5983333 3.5983333 6.1013892 5.9203572 5.1397653 5.1470264 4.7179650 4.3067151 3.9056435 3.4903498 3.2598653 3.0606990 2.8924495 2.7913065 3.9108782 3.8589130 4.3650583 3.8193368 3.7658267 4.0203365 3.7464232 3.7050224 3.8320614 3.6942498 3.6657190 3.7285952 6.418067e+00 5.5822237 5.1910526 5.7611289 5.3900833 4.9376795 4.7755047 4.4630113 4.2442940 4.1784287 4.1535670 4.0361142 4.1969130 4.1858766 4.7215529 4.2985980 4.2868719 4.5737411 4.3510523 4.3417089 4.4952930 4.3780807 4.3714635 4.4536672 12.9033412 14.3702306 13.6094087 12.4329890 13.0086409 12.1494337 11.3515892 10.8322386 10.5849708 10.3442391 10.3014626 10.5715793 2.827593e+00 5.0647919 9.9032571 -2.211545e-01 3.837791e+00 7.005361e+00 1.897978e+00 5.0104979 2.971441 3.98968502 4.001390 4.989016e+00 3 4.0 3 3 3 3 3.0 3.0 2.0 3 2 4.0 EqualMeans_12_ASE
701001906 TAAKA VODKA 80 1L 701001906 4.701657e-03 2.324110e-01 inconclusive white noise 0.25007229 0.01000000 0.05352414 inconclusive 65.2421581 65.6767735 65.4695085 59.6613889 55.7436966 53.1857479 51.1165171 49.5479274 47.2526994 45.3416453 42.9647688 40.5688675 8.1166667 8.1166667 8.1166667 8.1166667 8.1166667 8.1166667 8.1166667 8.1166667 8.1166667 8.1166667 8.1166667 8.1166667 85.6532674 78.3684495 78.3403061 75.3847626 70.1241569 67.8788493 64.9288995 62.8958034 60.2088286 57.8759763 55.0380537 51.8806305 14.4341932 14.2992145 14.2981344 13.8378853 13.5695530 13.3717741 13.1063023 12.8707520 12.6607333 12.4485251 12.2471629 12.0581166 7.502760e+01 72.4998836 66.2607202 62.0471258 56.6378845 53.7960147 51.3101253 50.7398992 50.4118597 51.3105130 50.7607084 49.5530079 16.8900802 14.4266741 16.4785885 15.8949595 15.5535072 16.2036223 15.5111407 15.9504079 15.9285781 15.6921148 15.9496297 15.7800948 70.6317652 70.6193852 84.1328390 86.1232897 87.6434001 87.6274218 86.3545689 89.4743434 92.0583899 95.7837302 98.3255336 99.7407462 1.378831e+01 16.7230399 31.2335027 6.236520e+00 1.494705e+01 1.903011e+01 1.666967e+01 23.7685567 15.962763 22.18950698 19.465098 2.001956e+01 5 10.0 8 12 11 7 5.0 4.0 4.0 7 5 10.0 EqualMeans_12_ASE
701001907 TAAKA VODKA 80 1L 701001907 0.000000e+00 0.000000e+00 not white noise NA 0.42321723 0.01000000 0.01000000 not stationary 198.1483532 202.6365583 206.4005754 182.9596994 171.3135840 163.8738660 158.2928221 155.6318788 153.1012307 151.9063532 150.0285164 147.7516011 15.5316667 15.5316667 15.5316667 15.5316667 15.5316667 15.5316667 15.5316667 15.5316667 15.5316667 15.5316667 15.5316667 15.5316667 163.0706045 147.6514991 142.0327887 118.6811530 102.0842851 93.9061365 88.8143283 89.1300378 90.6734892 93.6587780 96.6549372 98.3048675 22.8958642 23.2461938 22.9222282 22.5535981 22.4030964 22.1708292 21.9334597 21.7335775 21.5290731 21.3288296 21.1394194 20.9548197 1.501983e+02 143.3290122 141.7302822 119.6492689 106.8935998 97.5921329 92.7298300 94.7295674 97.4315877 102.3187664 106.9094471 111.2762217 22.9247349 23.6428572 23.5853520 23.4369136 23.5165456 23.5172404 23.4976499 23.5061535 23.5071332 23.5046404 23.5055066 23.5057268 182.8480991 165.3978276 172.7950756 165.8161092 160.9457245 156.9136823 154.9305126 158.5704392 161.8352075 168.1169377 174.1008125 178.8359459 1.700000e+01 21.0000000 50.0000000 1.000000e+00 2.200000e+01 2.500000e+01 1.900000e+01 27.0000000 19.000000 27.00000000 25.000000 2.400000e+01 28 25.0 26 23 30 22 7.0 4.0 5.0 5 8 21.0 ARMA_12_ASE
700005900 TAAKA VODKA 80 1L 700005900 2.343884e-02 1.671774e-01 inconclusive white noise 0.18041707 0.01000000 0.04977124 not stationary 1.1002137 1.2694444 1.3378205 1.4354701 1.5084188 1.5634615 1.6097375 1.6434829 1.6663105 1.6832906 1.7279526 1.7576923 1.8833333 1.8833333 1.8833333 1.8833333 1.8833333 1.8833333 1.8833333 1.8833333 1.8833333 1.8833333 1.8833333 1.8833333 1.0595516 1.3538109 1.4839001 1.5426432 1.5814597 1.6259222 1.6660457 1.6941691 1.7063527 1.7177220 1.7584874 1.7871770 2.5412846 2.2836974 1.8833333 1.8833333 1.8833333 1.8833333 1.8833333 1.8833333 1.8833333 1.8833333 1.8833333 1.8833333 1.101310e+00 1.3801037 1.3854369 1.5228097 1.5577902 1.5402714 1.5416878 1.5752095 1.5914634 1.6536299 1.7103440 1.7389881 1.2338905 1.0000244 1.0000244 1.0000244 1.0000244 1.0000244 1.0000244 1.0000244 1.0000244 1.0000244 1.0000244 1.0000244 1.1350347 1.5327785 1.7377441 2.0966865 2.4001221 2.5704244 2.7177394 2.8033499 2.8996504 2.9787477 3.0430483 3.0968104 3.179249e+00 1.6499882 3.0000000 0.000000e+00 1.000000e+00 2.000000e+00 3.000000e+00 3.0000000 3.000000 2.00000000 3.000000 3.000000e+00 3 4.0 3 4 4 3 1.0 3.0 1.0 3 4 2.0 ARIMA_12_ASE
701001768 TAAKA VODKA 80 1L 701001768 0.000000e+00 0.000000e+00 not white noise NA 0.48537100 0.01000000 0.10000000 inconclusive 4.8252590 4.7309000 4.6891906 4.6548744 4.4625923 4.1009000 3.8908267 3.6955154 3.6434926 3.5806949 3.4830212 3.3908573 4.7800000 4.7800000 4.7800000 4.7800000 4.7800000 4.7800000 4.7800000 4.7800000 4.7800000 4.7800000 4.7800000 4.7800000 5.2605927 5.2971241 5.2878247 5.1661669 4.8449283 4.4788421 4.1976426 3.9212539 3.8133806 3.6862767 3.5379249 3.3946633 5.2292753 5.1602537 5.1018358 5.0523925 5.0105452 4.9751268 4.9451497 4.9197779 4.8983040 4.8801291 4.8647464 4.8517269 5.732139e+00 5.7316454 5.9547820 5.9448081 5.6364189 5.3917974 5.0619394 4.6936530 4.5424800 4.3541588 4.1646626 3.9649667 5.0704608 5.0704608 5.0704608 5.0704608 5.0704608 5.0704608 5.0704608 5.0704608 5.0704608 5.0704608 5.0704608 5.0704608 4.9079529 4.9796347 5.0235500 5.3625069 5.1204962 4.9727518 4.8140382 4.7272246 4.7013188 4.6820765 4.7368283 4.7764556 4.750496e+00 5.5412219 6.3569667 9.194740e+00 1.051907e+00 3.926150e+00 2.815428e+00 3.7179421 3.632111 2.55654143 6.490006 6.431425e+00 4 5.0 4 5 4 3 2.0 3.0 1.0 5 4 4.0 EqualMeans_12_ASE
700005850 TAAKA VODKA 80 1L 700005850 7.619964e-01 5.395173e-01 white noise white noise 0.05366716 0.01000000 0.10000000 inconclusive 0.7946959 0.8499524 0.8584566 0.8650806 0.8504908 0.8458498 0.8291648 0.8163306 0.8088270 0.8013113 0.7960479 0.7916831 1.6633333 1.6633333 1.6633333 1.6633333 1.6633333 1.6633333 1.6633333 1.6633333 1.6633333 1.6633333 1.6633333 1.6633333 0.9313236 0.9150902 0.8734208 0.8846560 0.8540705 0.8458284 0.8180487 0.7992410 0.8014471 0.7953921 0.7858098 0.7843329 1.1990399 1.6633333 1.6633333 1.6633333 1.6633333 1.6633333 1.6633333 1.6633333 1.6633333 1.6633333 1.6633333 1.6633333 1.668124e+00 1.7099588 1.4339802 1.4716291 1.4078535 1.4279774 1.3607470 1.3316285 1.2889480 1.2815764 1.2452635 1.2593410 -0.2756279 0.6273774 0.3784424 0.4470673 0.4281492 0.4333644 0.4319267 0.4323230 0.4322138 0.4322439 0.4322356 0.4322379 2.2656312 2.5005957 2.5645920 2.5893030 2.5160865 2.4683782 2.4140848 2.3876108 2.3643841 2.3484751 2.3305555 2.3184846 1.250166e+00 1.0000000 3.0000000 0.000000e+00 2.000000e+00 3.000000e+00 2.000000e+00 2.0000000 1.000000 2.00000000 2.000000 3.000000e+00 1 3.0 2 3 3 1 1.0 2.0 1.0 1 1 2.0 ARMA_12_ASE
701001830 TAAKA VODKA 80 1L 701001830 3.036074e-07 1.098736e-05 not white noise NA 0.01094855 0.01000000 0.01000000 inconclusive 3.3812607 3.3274145 3.5419444 3.2107479 2.9817735 2.8650214 2.8658761 2.8812607 2.8883832 2.8969017 2.9194891 2.9395940 2.1500000 2.1500000 2.1500000 2.1500000 2.1500000 2.1500000 2.1500000 2.1500000 2.1500000 2.1500000 2.1500000 2.1500000 4.0075461 3.4573960 3.5632091 3.2119952 2.9633191 2.8283792 2.8212973 2.8343839 2.8403766 2.8490921 2.8750325 2.8932145 2.6117949 2.5657214 2.5242446 2.4869061 2.4532928 2.4230331 2.3957925 2.3712696 2.3491934 2.3293198 2.3114290 2.2953231 5.693141e+00 5.0198774 5.5617559 5.3414683 5.1786422 5.1347258 5.2635862 5.2865471 5.2943238 5.2846495 5.1757291 5.0886369 1.3356365 1.5349088 1.2718390 1.1519197 1.0750150 1.0476987 1.0247556 1.0139917 1.0077459 1.0043690 1.0024185 1.0013730 4.7621704 4.6118544 4.6386722 4.2674657 4.0447418 3.8577976 3.8231672 3.7875790 3.7342582 3.6916017 3.6776798 3.6660783 4.000000e+00 2.0000000 7.0000000 0.000000e+00 3.000000e+00 3.000000e+00 2.000000e+00 3.0000000 3.000000 2.00000000 3.000000 4.000000e+00 3 4.0 5 4 3 4 5.0 3.0 2.0 3 1 3.0 ARMA_12_ASE
701001767 TAAKA VODKA 80 1L 701001767 1.572929e-01 3.914269e-01 white noise white noise 0.34274666 0.01000000 0.10000000 inconclusive 1.3459188 1.3023291 1.2066026 1.0946368 1.0100214 0.9544658 0.9140507 0.8667521 0.8387963 0.8400214 0.8181799 0.7995513 2.2166667 2.2166667 2.2166667 2.2166667 2.2166667 2.2166667 2.2166667 2.2166667 2.2166667 2.2166667 2.2166667 2.2166667 1.9333380 1.6235733 1.4734965 1.3692537 1.2889112 1.1850200 1.1032948 1.0376552 0.9962394 0.9859819 0.9518440 0.9239290 2.3807007 2.1586414 2.9171391 2.5688481 2.2957120 2.3980851 2.2483458 2.5293585 2.3935057 2.3247667 2.3487997 2.2723652 1.750115e+00 1.6015794 1.4961143 1.4375831 1.3589958 1.2541742 1.1713232 1.1220013 1.0900889 1.0678670 1.0191809 0.9856034 2.4672700 2.3263118 3.1237031 2.7179263 2.4276452 2.5866173 2.4886757 2.8069577 2.6373311 2.5623943 2.6135525 2.5630514 3.5248317 3.1975521 3.0058058 2.8039407 2.5891514 2.4424681 2.3937548 2.2516280 2.1680245 2.1171107 2.0662856 2.0406461 1.388334e+00 -0.1222036 4.3714579 9.221621e-01 1.751937e+00 2.126097e+00 9.330889e-01 2.1345194 1.948275 3.94710235 3.034467 1.974070e+00 1 2.0 1 2 2 2 2.0 2.0 1.0 4 2 3.0 EqualMeans_12_ASE
701001810 TAAKA VODKA 80 1L 701001810 0.000000e+00 0.000000e+00 not white noise NA 0.54437889 0.01000000 0.01060199 not stationary 2.7694231 2.9386538 3.0241239 2.5476282 2.2068590 1.9775427 1.8086172 1.6787179 1.5862322 1.5060897 1.4374883 1.3850214 2.1500000 2.1500000 2.1500000 2.1500000 2.1500000 2.1500000 2.1500000 2.1500000 2.1500000 2.1500000 2.1500000 2.1500000 4.5910109 4.3387866 4.0374311 3.4712152 3.0265545 2.7291639 2.5120868 2.3031515 2.1768817 2.0924796 1.9910859 1.8807362 1.9994117 2.0113054 2.0222596 2.0323487 2.0416410 2.0501993 2.0580817 2.0653416 2.0720280 2.0781863 2.0838583 2.0890822 4.163263e+00 4.1005963 3.8469651 3.5846134 3.2781221 3.0622591 2.8507899 2.7383287 2.5955131 2.6034540 2.5522387 2.4843749 1.9763079 1.9763079 1.9763079 1.9763079 1.9763079 1.9763079 1.9763079 1.9763079 1.9763079 1.9763079 1.9763079 1.9763079 4.2968421 4.2911908 4.8025444 5.3729971 5.2736339 5.1200821 5.0757839 4.9578981 4.8594204 4.7532709 4.6769437 4.5169437 1.511649e+00 1.5856716 6.6484741 -2.982427e-01 1.746964e+00 1.785318e+00 1.817859e+00 1.8454674 0.868891 1.88876405 1.905625 1.919930e+00 0 0.0 1 2 2 2 2.0 2.0 1.0 2 2 1.0 EqualMeans_12_ASE
700005866 TAAKA VODKA 80 1L 700005866 0.000000e+00 0.000000e+00 not white noise NA 0.31221025 0.02148804 0.03174915 not stationary 41.0203241 39.3216062 37.4481019 36.1557088 34.5091447 32.8639994 31.5960751 30.2733370 28.8379310 27.3446318 25.8320957 24.2926318 7.3283333 7.3283333 7.3283333 7.3283333 7.3283333 7.3283333 7.3283333 7.3283333 7.3283333 7.3283333 7.3283333 7.3283333 2.0775360 2.3394179 2.5571922 2.9196070 3.1780195 3.4797540 4.2895843 5.0141588 5.4157855 5.5611932 5.6039443 5.5032397 3.1421683 4.7655097 4.2451054 4.9756542 4.9146008 5.2965478 5.3803732 5.6156141 5.7338443 5.8991854 6.0148171 6.1410207 2.214432e+00 2.4734601 2.8964279 3.4077682 4.0111561 4.7870135 6.4359796 8.1630524 9.6417922 11.0790659 12.4832663 13.8160406 2.5152302 4.0587504 3.0999274 3.6955410 3.3255503 3.5553857 3.4126137 3.5013026 3.4462097 3.4804330 3.4591738 3.4723798 9.2666327 8.9026054 10.6855680 13.0907783 15.4853964 17.6714293 20.6486179 23.4194441 25.6164912 27.6086889 29.5849732 31.2513160 6.541185e-01 2.0293576 3.2816330 8.918506e-01 1.890484e+00 2.598173e+00 1.513890e+00 0.4059347 1.314475 1.25664156 1.200629 5.160187e+00 4 4.0 5 4 7 7 12.0 5.0 4.0 7 6 7.0 ARMA_12_ASE
701001880 TAAKA VODKA 80 1L 701001880 3.857241e-01 7.674317e-01 white noise white noise 0.02966138 0.01000000 0.01000000 inconclusive 1.4269017 1.4461325 1.4610897 1.4794658 1.4438248 1.4059615 1.3686600 1.3381197 1.3157906 1.2974145 1.2604681 1.1828846 1.3666667 1.3666667 1.3666667 1.3666667 1.3666667 1.3666667 1.3666667 1.3666667 1.3666667 1.3666667 1.3666667 1.3666667 1.5174396 1.4948883 1.4825224 1.5006991 1.4644323 1.4215440 1.3823838 1.3492160 1.3240311 1.3028449 1.2655291 1.1871722 1.1998213 1.3666667 1.3666667 1.3666667 1.3666667 1.3666667 1.3666667 1.3666667 1.3666667 1.3666667 1.3666667 1.3666667 2.006564e+00 2.3342891 2.3004118 2.3140128 2.2600330 2.2419669 2.2286639 2.2570145 2.3453982 2.3518083 2.3005831 2.2235996 2.2651424 2.8990216 2.4129341 2.0937681 2.4508967 2.4996365 2.3321244 2.3382486 2.4198043 2.3981070 2.3645226 2.3816840 3.1199556 3.1503628 2.7148049 2.6544759 2.6625206 2.6213930 2.4272105 2.3303058 2.2490123 2.1530840 2.0921738 2.0336181 6.240092e-01 1.3893508 0.4234414 1.629559e+00 -6.083827e-01 -5.406915e-01 9.984264e-01 0.1504591 1.624386 2.57950379 3.559803 8.524046e-01 2 2.0 2 2 1 1 2.0 1.0 1.0 2 1 2.0 EqualMeans_12_ASE
700005861 TAAKA VODKA 80 1L 700005861 2.798171e-05 8.768368e-04 not white noise NA 0.11665129 0.01000000 0.04796742 not stationary 3.1449053 3.4033669 3.4895207 3.0920848 2.8322387 2.6534524 2.5257478 2.4283669 2.3526261 2.2995464 2.2598471 2.2449908 1.2783333 1.2783333 1.2783333 1.2783333 1.2783333 1.2783333 1.2783333 1.2783333 1.2783333 1.2783333 1.2783333 1.2783333 2.9120469 3.2251489 3.3751316 3.1821920 2.9660736 2.8280312 2.6700627 2.5279470 2.3702667 2.2522066 2.1634190 2.1149156 1.9633104 1.8684188 1.7866728 1.7162512 1.6555854 1.6033237 1.5583020 1.5195172 1.4861054 1.4573222 1.4325264 1.4111657 2.962186e+00 3.4010894 3.5663049 3.4222635 3.2474177 3.0839616 2.9365710 2.7409038 2.5170765 2.3283588 2.1689325 2.0708163 2.0995448 2.0995448 2.0995448 2.0995448 2.0995448 2.0995448 2.0995448 2.0995448 2.0995448 2.0995448 2.0995448 2.0995448 6.0699551 5.8170034 5.8041211 5.1472329 4.7108524 4.4383617 4.1424992 3.8847447 3.6384809 3.4857644 3.3418270 3.2749200 2.156258e+00 3.1286190 6.1058690 8.714302e-02 2.071729e+00 1.059042e+00 1.048599e+00 1.0400025 1.032927 1.02710284 2.022309 4.018363e+00 3 4.0 3 2 1 2 1.0 1.0 1.0 2 1 3.0 ARIMA_12_ASE
701001850 TAAKA VODKA 80 1L 701001850 3.111778e-09 1.111885e-09 not white noise NA 0.01000000 0.01000000 0.01000000 inconclusive 1.6864744 1.6531410 1.6420299 1.6210897 1.6695513 1.6646795 1.6198077 1.6082692 1.5995798 1.5944231 1.5687587 1.5544231 1.7833333 1.7833333 1.7833333 1.7833333 1.7833333 1.7833333 1.7833333 1.7833333 1.7833333 1.7833333 1.7833333 1.7833333 0.9471051 0.9410728 0.9583839 0.9320713 1.0150731 1.0192416 0.9862771 0.9582185 0.9320831 0.9355995 0.9036402 0.8910035 0.6945360 1.3803241 0.8504484 1.1642663 1.0882857 1.0855645 1.1544780 1.1234983 1.1647393 1.1702968 1.1837013 1.2018058 1.231704e+00 1.3687870 1.4382336 1.2802140 1.2448374 1.1547863 1.0938548 1.0693608 1.0896346 1.0644152 1.0024592 0.9485882 0.7516630 1.2945436 0.6991328 1.2715343 1.0815054 0.8580775 1.1862125 0.9383167 1.0657447 1.0882255 0.9535772 1.0939614 1.8266180 1.9893472 1.8271548 2.1182253 1.9236300 1.8966680 1.7713696 1.7231753 1.6788265 1.6423503 1.6187286 1.5899860 1.649683e+00 0.4027416 0.2461327 2.052215e+00 -1.627674e-01 1.252866e-01 9.607176e-01 0.9776946 1.038822 -0.02528883 2.005146 1.007060e+00 2 2.0 1 0 0 1 2.0 0.0 1.0 1 1 1.0 ARMA_12_ASE
701001901 TAAKA VODKA 80 1L 701001901 6.819545e-12 7.586510e-10 not white noise NA 0.18541887 0.01000000 0.01000000 not stationary 0.7879701 1.0213034 1.1033547 1.1533547 1.1454060 1.1285684 1.1388858 1.1482265 1.1731553 1.1741239 1.1772475 1.1804915 1.5333333 1.5333333 1.5333333 1.5333333 1.5333333 1.5333333 1.5333333 1.5333333 1.5333333 1.5333333 1.5333333 1.5333333 0.7687278 0.8821437 0.9522771 0.9727396 0.9590509 0.9318883 0.9316880 0.9346157 0.9576802 0.9540655 0.9598836 0.9652515 1.8236440 1.7776671 1.7389717 1.7064044 1.6789949 1.6559263 1.6365111 1.6201707 1.6064181 1.5948436 1.5851021 1.5769034 7.399023e-01 0.8315413 0.8883643 0.8961124 0.8765321 0.8336705 0.8133006 0.7998427 0.8038369 0.7852240 0.7804549 0.7791951 1.9453676 1.9453676 1.9453676 1.9453676 1.9453676 1.9453676 1.9453676 1.9453676 1.9453676 1.9453676 1.9453676 1.9453676 0.6230959 0.8141515 0.8558566 0.9235350 0.9969168 1.0146397 1.0315406 1.0370816 1.0421818 1.0407774 1.0285619 1.0280019 6.237002e-01 1.8583984 0.9467154 2.979949e+00 -7.545188e-03 1.997161e+00 1.998932e+00 1.9995980 2.999849 1.99994307 1.999979 1.999992e+00 1 4.0 2 2 2 2 3.0 2.0 3.0 2 2 1.0 ARIMA_12_ASE
701001904 TAAKA VODKA 80 1L 701001904 9.048454e-08 5.283449e-07 not white noise NA 0.43473483 0.01000000 0.01000000 not stationary 1.1955769 1.2096795 1.2229274 1.2218590 1.2048077 1.1964316 1.1941117 1.1949359 1.1944373 1.1976282 1.2035023 1.2069017 1.4666667 1.4666667 1.4666667 1.4666667 1.4666667 1.4666667 1.4666667 1.4666667 1.4666667 1.4666667 1.4666667 1.4666667 1.4841602 1.5389074 1.4902713 1.4144033 1.3738584 1.3599818 1.3405575 1.3257438 1.3175436 1.3013227 1.3052061 1.3102041 1.5810320 2.0646698 2.6573867 1.9097428 1.9640995 1.9062874 1.9416191 1.7303295 1.7743717 1.7186676 1.6788633 1.6447738 1.282673e+00 1.5206545 1.4229317 1.3809908 1.4082162 1.4251940 1.4167668 1.4330891 1.4325368 1.4267040 1.4439083 1.4253409 1.8423873 2.4863038 3.2129767 2.5352098 2.6448515 2.6991264 2.8165294 2.6127613 2.7216841 2.7222384 2.6995275 2.6989619 3.0800760 2.3915354 2.3939485 2.4090143 2.4395653 2.3694690 2.3644406 2.3630603 2.3654867 2.3960114 2.4235625 2.3890228 1.143407e+00 2.2319445 4.0112431 1.447822e-01 1.509765e+00 1.494126e+00 1.106289e+00 2.2140312 1.235630 1.06777297 3.091769 4.110406e+00 2 2.0 2 3 1 2 2.0 1.0 2.0 2 2 3.0 EqualMeans_12_ASE
701000321 TAAKA VODKA 80 1L 701000321 9.021729e-04 1.759268e-02 not white noise NA 0.01899300 0.01000000 0.10000000 stationary 1.1710043 1.2004915 1.2094658 1.0908761 0.9925427 0.9056197 0.8398687 0.7668376 0.7063319 0.6671581 0.6332420 0.6049786 1.2166667 1.2166667 1.2166667 1.2166667 1.2166667 1.2166667 1.2166667 1.2166667 1.2166667 1.2166667 1.2166667 1.2166667 4.9505043 2.9344969 2.3457840 2.5624829 2.4150441 2.2656664 2.1414018 1.9553184 1.8213283 1.7053062 1.6001769 1.4984614 1.5723548 1.4633890 1.5054031 1.2272708 1.0921195 1.0500487 1.0002845 1.0361209 1.1136744 1.1867192 1.2578197 1.3051289 1.322547e+00 1.7211078 1.8703293 1.9101641 1.8088129 1.6926424 1.6207221 1.5910010 1.5188421 1.4191297 1.3462616 1.3141439 1.2204117 1.0000166 1.0000166 1.0000166 1.0000166 1.0000166 1.0000166 1.0000166 1.0000166 1.0000166 1.0000166 1.0000166 0.8263359 0.7231268 0.9128621 1.1243435 1.1876421 1.1582706 1.1786536 1.1696388 1.1729235 1.1849318 1.2007783 1.2167080 2.000000e+00 2.0000000 4.0000000 -2.405483e-17 -1.350771e-16 1.000000e+00 -9.344377e-17 1.0000000 1.000000 1.00000000 1.000000 2.000000e+00 2 2.0 1 1 2 2 1.0 1.0 1.0 0 1 1.0 EqualMeans_12_ASE
701001902 TAAKA VODKA 80 1L 701001902 0.000000e+00 1.110223e-16 not white noise NA 0.36038955 0.01000000 0.01000000 not stationary 1.2988034 1.3129060 1.3201709 1.4180342 1.4875214 1.5586325 1.7266422 1.8734829 1.9894017 2.0936752 2.1824864 2.2449573 1.8000000 1.8000000 1.8000000 1.8000000 1.8000000 1.8000000 1.8000000 1.8000000 1.8000000 1.8000000 1.8000000 1.8000000 1.3417939 1.3484977 1.3506908 1.3635321 1.4317118 1.5017399 1.6695923 1.8108711 1.9283069 2.0358965 2.1287877 2.1928990 3.7100420 2.9400814 2.4805010 2.2061830 2.0424458 1.9447130 1.8863775 1.8515577 1.8307742 1.8183687 1.8109641 1.8065443 1.367044e+00 1.4393103 1.4454570 1.2712999 1.3515299 1.4066517 1.4658585 1.5148079 1.6072195 1.7576524 1.8606205 1.9186453 3.9779756 3.9779756 3.9779756 3.9779756 3.9779756 3.9779756 3.9779756 3.9779756 3.9779756 3.9779756 3.9779756 3.9779756 2.1767938 1.9467462 1.9045347 1.7544638 1.7551391 1.7862844 1.8603817 1.9505741 1.9893415 2.0347064 2.0739335 2.1491457 2.624291e+00 3.4435520 3.0438653 2.816562e+00 1.619171e+00 2.475240e+00 2.363029e+00 3.2778318 1.212473 2.16253670 3.124322 5.095097e+00 2 2.0 2 4 2 3 5.0 3.0 3.0 1 2 2.0 ARIMA_12_ASE
700004770 TAAKA VODKA 80 1L 700004770 0.000000e+00 0.000000e+00 not white noise NA 0.67246321 0.01000000 0.01000000 not stationary 2.9373276 2.9334814 2.4566438 2.3000840 2.2445583 2.2117293 2.0643972 1.9509494 1.8610028 1.8277122 1.8067681 1.7906182 3.3316667 3.3316667 3.3316667 3.3316667 3.3316667 3.3316667 3.3316667 3.3316667 3.3316667 3.3316667 3.3316667 3.3316667 2.7372199 2.7608743 2.6294740 2.5938914 2.5092408 2.5661585 2.6474384 2.7557645 2.9071031 3.0625002 3.0725270 3.1218363 2.9293446 2.9539608 2.9770709 2.9987670 3.0191356 3.0382579 3.0562102 3.0730642 3.0888869 3.1037414 3.1176871 3.1307795 3.295872e+00 2.7258590 2.6967588 2.7422302 2.7448767 2.7308850 2.8594171 3.0683988 3.2781511 3.5145773 3.5802386 3.7311803 2.9725420 2.9725420 2.9725420 2.9725420 2.9725420 2.9725420 2.9725420 2.9725420 2.9725420 2.9725420 2.9725420 2.9725420 15.3958816 15.8869049 15.9214910 15.3606947 15.1356711 14.9409582 14.6203682 14.6236395 14.4563891 14.2016280 13.3333187 12.5893127 1.306533e+00 4.7272362 2.0822285 1.381773e+00 2.634530e+00 4.847809e+00 3.027774e+00 2.1796301 2.307767 1.41588971 3.507124 1.584109e+00 4 4.0 3 1 2 2 4.0 2.0 3.0 1 2 5.0 EqualMeans_12_ASE
701000320 TAAKA VODKA 80 1L 701000320 7.397740e-02 1.020833e-01 white noise white noise 0.02456406 0.01000000 0.10000000 stationary 0.3058120 0.2891453 0.2835897 0.2808120 0.2801709 0.2660684 0.2607570 0.2574145 0.2610826 0.2742735 0.2852991 0.2949145 1.1500000 1.1500000 1.1500000 1.1500000 1.1500000 1.1500000 1.1500000 1.1500000 1.1500000 1.1500000 1.1500000 1.1500000 0.4051081 0.3400124 0.3178584 0.3010784 0.3005917 0.2830615 0.2753256 0.2701542 0.2723935 0.2844376 0.2945231 0.3040786 1.1262931 1.1500000 1.1500000 1.1500000 1.1500000 1.1500000 1.1500000 1.1500000 1.1500000 1.1500000 1.1500000 1.1500000 3.367507e-01 0.3334983 0.3298248 0.3271361 0.3369339 0.3258995 0.3179715 0.3165767 0.3249886 0.3380303 0.3485719 0.3592423 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0951482 1.0391884 1.0373243 0.9956590 0.9750075 0.9688032 0.9617803 0.9495702 0.9384780 0.9410152 0.9327267 0.9238507 -2.835440e-01 1.0000000 1.0000000 1.000000e+00 0.000000e+00 2.000000e+00 1.000000e+00 1.0000000 1.000000 1.00000000 1.000000 1.000000e+00 2 2.0 1 1 1 1 0.0 1.0 2.0 0 1 1.0 EqualMeans_12_ASE
700005926 TAAKA VODKA 80 1L 700005926 0.000000e+00 0.000000e+00 not white noise NA 0.02043425 0.01000000 0.01000000 inconclusive 1.2773077 1.2785897 1.2738889 1.2734615 1.2670513 1.2888462 1.3058791 1.3186538 1.3055128 1.2732051 1.2467716 1.2067949 1.5333333 1.5333333 1.5333333 1.5333333 1.5333333 1.5333333 1.5333333 1.5333333 1.5333333 1.5333333 1.5333333 1.5333333 1.4330655 1.5153141 1.4548217 1.5009097 1.3966455 1.3343924 1.2841664 1.2087831 1.1483447 1.0884805 1.0262071 0.9793421 2.2002900 2.1617869 2.1255065 2.0913205 2.0591081 2.0287553 2.0001548 1.9732053 1.9478117 1.9238840 1.9013376 1.8800928 2.667315e+00 3.4118599 3.8792223 3.8945939 4.0508092 3.9659928 3.9156449 3.7875039 3.7042064 3.5755196 3.5150700 3.4031691 1.6954044 1.9238215 2.0300241 1.9299860 2.3085755 2.3687749 2.2688382 2.2545610 2.2051669 2.0706909 2.0700251 2.1066515 9.7833663 7.4145723 5.6429707 4.8216838 4.4154853 4.1634533 3.9056714 3.6334260 3.4048642 3.2365527 3.0866317 2.9483866 1.683491e+00 0.0158938 2.4608878 5.416634e-01 2.256431e+00 1.826491e+00 1.551416e+00 2.6000376 2.910352 2.25189453 3.394532 2.261570e+00 3 2.0 1 2 1 3 1.0 2.0 2.0 2 2 2.0 ARMA_12_ASE
701001800 TAAKA VODKA 80 1L 701001800 1.224362e-01 4.792812e-01 white noise white noise 0.21045181 0.01000000 0.03920430 not stationary 0.3269444 0.3769444 0.3799359 0.4064316 0.4248932 0.4372009 0.4547833 0.4801496 0.4956054 0.5087393 0.5194852 0.5196795 0.8333333 0.8333333 0.8333333 0.8333333 0.8333333 0.8333333 0.8333333 0.8333333 0.8333333 0.8333333 0.8333333 0.8333333 0.3269444 0.3769444 0.3799359 0.4064316 0.4248932 0.4372009 0.4547833 0.4801496 0.4956054 0.5087393 0.5194852 0.5196795 0.8333333 0.8333333 0.8333333 0.8333333 0.8333333 0.8333333 0.8333333 0.8333333 0.8333333 0.8333333 0.8333333 0.8333333 3.715443e-01 0.4106859 0.4270984 0.4572844 0.4870052 0.5077215 0.5265536 0.5514860 0.5634607 0.5780082 0.5876334 0.5895793 0.8826079 0.8826079 0.8826079 0.8826079 0.8826079 0.8826079 0.8826079 0.8826079 0.8826079 0.8826079 0.8826079 0.8826079 1.7195772 1.7795639 1.6700771 1.6177478 1.5964515 1.5903798 1.5545462 1.5487558 1.5511204 1.5446621 1.5448047 1.5176862 8.789558e-01 -0.2864555 1.7378374 3.338108e-01 1.039229e+00 -1.243127e-01 1.210245e+00 0.2435835 1.099384 0.97692315 2.054678 1.121891e+00 1 2.0 1 2 0 1 2.0 2.0 1.0 1 1 1.0 EqualMeans_12_ASE
700003059 TAAKA VODKA 80 1L 700003059 0.000000e+00 0.000000e+00 not white noise NA 0.01000000 0.01000000 0.01000000 inconclusive 1.3594872 1.3876923 1.3475214 1.3319231 1.3246154 1.2406838 1.1990476 1.1681410 1.1401140 1.1015385 1.0662471 1.0265812 0.7333333 0.7333333 0.7333333 0.7333333 0.7333333 0.7333333 0.7333333 0.7333333 0.7333333 0.7333333 0.7333333 0.7333333 0.7822079 0.8905432 0.8879031 0.9104011 0.9222210 0.8704409 0.8534507 0.8295435 0.8112416 0.7765995 0.7437519 0.7113119 0.9216603 1.5009765 0.9665898 1.4078036 0.9958728 1.3314352 1.0134655 1.2682290 1.0223817 1.2153779 1.0249141 1.1707156 2.591532e+00 2.7108124 2.4617483 2.3576535 2.2807949 2.1356822 2.1222404 2.1004201 2.0960634 2.0576792 2.0084829 1.9710193 1.2748582 1.3430106 0.7381308 1.0936850 1.1334287 0.9515117 1.0499681 1.0673239 1.0129014 1.0399485 1.0466752 1.0304761 1.7414562 1.8158592 1.7079300 1.6763549 1.7339938 1.7245794 1.7257332 1.7230273 1.6985303 1.6307441 1.5755449 1.5202460 -2.765066e-01 1.3644443 0.4884796 9.041992e-01 3.579109e+00 1.527870e+00 1.258682e+00 2.1668142 1.913767 1.70682274 1.791777 -9.828707e-02 1 0.0 1 1 1 1 2.0 1.0 2.0 1 2 0.0 ARMA_12_ASE
701000360 TAAKA VODKA 80 1L 701000360 0.000000e+00 0.000000e+00 not white noise NA 0.01782149 0.01000000 0.01000000 inconclusive 1.0547703 1.1156677 1.1445139 1.1615011 1.1998985 1.2030609 1.2641110 1.2986806 1.3393857 1.4147703 1.4755162 1.5616079 0.7083333 0.7083333 0.7083333 0.7083333 0.7083333 0.7083333 0.7083333 0.7083333 0.7083333 0.7083333 0.7083333 0.7083333 0.7409955 0.6622150 0.7679869 0.7996367 0.8200111 0.8356037 0.8565329 0.9073472 0.9353860 1.0023231 1.0571398 1.1326307 1.2880147 1.9607699 1.5563160 1.5176694 1.4476984 1.3413498 1.2904318 1.2191043 1.1667074 1.1166898 1.0722279 1.0332015 6.671504e-01 0.6490383 0.7694516 0.8198088 0.8097014 0.8220716 0.8006063 0.8420725 0.8396961 0.8555306 0.8745281 0.9032365 1.5484043 2.2453039 2.0482803 2.0237832 2.1001411 2.0408910 2.0708135 2.0614928 2.0611865 2.0640606 2.0616581 2.0629336 0.8000180 0.7884722 0.8333405 0.8557746 0.8692351 0.8782087 0.8846184 0.8894258 0.8931648 0.8961560 0.8986033 0.9006428 1.280019e+00 1.6965226 1.0000000 0.000000e+00 2.000000e+00 0.000000e+00 2.000000e+00 1.0000000 1.000000 2.00000000 1.000000 3.000000e+00 1 2.0 1 1 2 1 3.0 0.0 2.0 3 2 3.0 ARIMA_S12_12_ASE
700004711 TAAKA VODKA 80 1L 700004711 1.225766e-01 5.601297e-01 white noise white noise 0.34105678 0.01000000 0.01000000 not stationary 0.2550041 0.2575682 0.2569699 0.2547476 0.2537733 0.2535511 0.2547476 0.2746515 0.3067420 0.3466964 0.3926031 0.4436152 0.5166667 0.5166667 0.5166667 0.5166667 0.5166667 0.5166667 0.5166667 0.5166667 0.5166667 0.5166667 0.5166667 0.5166667 0.2550041 0.2575682 0.2569699 0.2547476 0.2537733 0.2535511 0.2547476 0.2746515 0.3067420 0.3466964 0.3926031 0.4436152 0.5166667 0.5166667 0.5166667 0.5166667 0.5166667 0.5166667 0.5166667 0.5166667 0.5166667 0.5166667 0.5166667 0.5166667 3.361097e-01 0.3155127 0.2919478 0.2764727 0.2586763 0.2496937 0.2544425 0.2763915 0.3005871 0.3288234 0.3599117 0.3946049 0.8174024 0.6424489 0.6798952 0.6718803 0.6735958 0.6732286 0.6733072 0.6732904 0.6732940 0.6732932 0.6732934 0.6732934 0.5959641 0.5948793 0.4870828 0.4477523 0.4126828 0.4140054 0.4148010 0.4167965 0.4173774 0.4165885 0.4219115 0.4476560 5.736152e-17 1.0000000 1.0000000 5.736152e-17 1.000000e+00 7.817820e-17 1.000000e+00 1.0000000 1.000000 1.00000000 1.000000 1.128727e-16 0 1.0 1 1 1 0 0.0 2.0 2.0 2 2 2.0 ARIMA_12_ASE
aggregated_forecast = results[c("Product_Type","Product","Customer","winning_12","ACTUAL_1","ACTUAL_2","ACTUAL_3","ACTUAL_4","ACTUAL_5","ACTUAL_6","ACTUAL_7","ACTUAL_8","ACTUAL_9","ACTUAL_10","ACTUAL_11","ACTUAL_12")]
for (i in 1:z){
  if (results$winning_12[i] == "EqualMeans_12_ASE"){
    aggregated_forecast$F1[i] <- results$EqualMeans_F1[i]
    aggregated_forecast$F2[i] <- results$EqualMeans_F2[i]
    aggregated_forecast$F3[i] <- results$EqualMeans_F3[i]
    aggregated_forecast$F4[i] <- results$EqualMeans_F4[i]
    aggregated_forecast$F5[i] <- results$EqualMeans_F5[i]
    aggregated_forecast$F6[i] <- results$EqualMeans_F6[i]
    aggregated_forecast$F7[i] <- results$EqualMeans_F7[i]
    aggregated_forecast$F8[i] <- results$EqualMeans_F8[i]
    aggregated_forecast$F9[i] <- results$EqualMeans_F9[i]
    aggregated_forecast$F10[i] <- results$EqualMeans_F10[i]
    aggregated_forecast$F11[i] <- results$EqualMeans_F11[i]
    aggregated_forecast$F12[i] <- results$EqualMeans_F12[i]
  } else if (results$winning_12[i] == "ARMA_12_ASE"){
    aggregated_forecast$F1[i] <- results$ARMA_F1[i]
    aggregated_forecast$F2[i] <- results$ARMA_F2[i]
    aggregated_forecast$F3[i] <- results$ARMA_F3[i]
    aggregated_forecast$F4[i] <- results$ARMA_F4[i]
    aggregated_forecast$F5[i] <- results$ARMA_F5[i]
    aggregated_forecast$F6[i] <- results$ARMA_F6[i]
    aggregated_forecast$F7[i] <- results$ARMA_F7[i]
    aggregated_forecast$F8[i] <- results$ARMA_F8[i]
    aggregated_forecast$F9[i] <- results$ARMA_F9[i]
    aggregated_forecast$F10[i] <- results$ARMA_F10[i]
    aggregated_forecast$F11[i] <- results$ARMA_F11[i]
    aggregated_forecast$F12[i] <- results$ARMA_F12[i]
  } else if (results$winning_12[i] == "ARIMA_12_ASE"){
    aggregated_forecast$F1[i] <- results$ARIMA_F1[i]
    aggregated_forecast$F2[i] <- results$ARIMA_F2[i]
    aggregated_forecast$F3[i] <- results$ARIMA_F3[i]
    aggregated_forecast$F4[i] <- results$ARIMA_F4[i]
    aggregated_forecast$F5[i] <- results$ARIMA_F5[i]
    aggregated_forecast$F6[i] <- results$ARIMA_F6[i]
    aggregated_forecast$F7[i] <- results$ARIMA_F7[i]
    aggregated_forecast$F8[i] <- results$ARIMA_F8[i]
    aggregated_forecast$F9[i] <- results$ARIMA_F9[i]
    aggregated_forecast$F10[i] <- results$ARIMA_F10[i]
    aggregated_forecast$F11[i] <- results$ARIMA_F11[i]
    aggregated_forecast$F12[i] <- results$ARIMA_F12[i]
  } else if (results$winning_12[i] == "ARIMA_S12_12_ASE"){
    aggregated_forecast$F1[i] <- results$ARIMA_S12_F1[i]
    aggregated_forecast$F2[i] <- results$ARIMA_S12_F2[i]
    aggregated_forecast$F3[i] <- results$ARIMA_S12_F3[i]
    aggregated_forecast$F4[i] <- results$ARIMA_S12_F4[i]
    aggregated_forecast$F5[i] <- results$ARIMA_S12_F5[i]
    aggregated_forecast$F6[i] <- results$ARIMA_S12_F6[i]
    aggregated_forecast$F7[i] <- results$ARIMA_S12_F7[i]
    aggregated_forecast$F8[i] <- results$ARIMA_S12_F8[i]
    aggregated_forecast$F9[i] <- results$ARIMA_S12_F9[i]
    aggregated_forecast$F10[i] <- results$ARIMA_S12_F10[i]
    aggregated_forecast$F11[i] <- results$ARIMA_S12_F11[i]
    aggregated_forecast$F12[i] <- results$ARIMA_S12_F12[i]
  }
}

# other time series that did not have enough data points, will use mean for forecasts
zz = nrow(combinations_mean)
results_mean <- data.frame(Product_Type=integer(),
                      Product=character(),
                      Customer=integer(),
                      EqualMeans_F1=double(),
                      EqualMeans_F2=double(),
                      EqualMeans_F3=double(),
                      EqualMeans_F4=double(),
                      EqualMeans_F5=double(),
                      EqualMeans_F6=double(),
                      EqualMeans_F7=double(),
                      EqualMeans_F8=double(),
                      EqualMeans_F9=double(),
                      EqualMeans_F10=double(),
                      EqualMeans_F11=double(),
                      EqualMeans_F12=double(),
                      ACTUAL_1=double(),
                      ACTUAL_2=double(),
                      ACTUAL_3=double(),
                      ACTUAL_4=double(),
                      ACTUAL_5=double(),
                      ACTUAL_6=double(),
                      ACTUAL_7=double(),
                      ACTUAL_8=double(),
                      ACTUAL_9=double(),
                      ACTUAL_10=double(),
                      ACTUAL_11=double(),
                      ACTUAL_12=double(),
                      stringsAsFactors = FALSE)

# loop through sample combinations
for(i in 1:zz) {
  sample_combinations1 = combinations_mean[i,]
  temp1 = inner_join(temp_mean,sample_combinations1)
  product = sample_combinations1$Product
  customer = sample_combinations1$Customer_ID
  product_type = sample_combinations1$Customer_ID
  
  results_mean[i,"Product_Type"] = product_type
  results_mean[i,"Product"] = as.character(sample_combinations1$Product)
  results_mean[i,"Customer"] = customer
  
  par(mfrow=c(1,1))
  plot.ts(temp1$STD_Cases, 
          main=c(paste("Standard Case Sales of ", product), 
                 paste("for Customer",customer)),
          xlab="Months",
          ylab="Standard Cases")
  
  j=12
  
  #Equal Means Model
  
  trainingSize = 60
  ASEHolder1 = numeric()
  ASEHolder2 = numeric()
  ASEHolder3 = numeric()
  ASEHolder4 = numeric()
  ASEHolder5 = numeric()
  ASEHolder6 = numeric()
  ASEHolder7 = numeric()
  ASEHolder8 = numeric()
  ASEHolder9 = numeric()
  ASEHolder10 = numeric()
  ASEHolder11 = numeric()
  ASEHolder12 = numeric()

  for( k in 1:(84-(trainingSize + j) + 1))
  {
    sink("file")
    model0_mean = mean(temp1$STD_Cases[k:(k+(trainingSize-1))])
    ASEHolder1[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 1 - 1)] - model0_mean)^2)
    ASEHolder2[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 2 - 1)] - model0_mean)^2)
    ASEHolder3[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 3 - 1)] - model0_mean)^2)
    ASEHolder4[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 4 - 1)] - model0_mean)^2)
    ASEHolder5[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 5 - 1)] - model0_mean)^2)
    ASEHolder6[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 6 - 1)] - model0_mean)^2)
    ASEHolder7[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 7 - 1)] - model0_mean)^2)
    ASEHolder8[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 8 - 1)] - model0_mean)^2)
    ASEHolder9[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 9 - 1)] - model0_mean)^2)
    ASEHolder10[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 10 - 1)] - model0_mean)^2)
    ASEHolder11[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 11 - 1)] - model0_mean)^2)
    ASEHolder12[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 12 - 1)] - model0_mean)^2)
    
    sink()
    
    assign(paste("EqualMeans_Results_",k,sep=""),(temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + j - 1)] - model0_mean)^2)
  }
  
  WindowedASE1 = mean(ASEHolder1)
  WindowedASE2 = mean(ASEHolder2)
  WindowedASE3 = mean(ASEHolder3)
  WindowedASE4 = mean(ASEHolder4)
  WindowedASE5 = mean(ASEHolder5)
  WindowedASE6 = mean(ASEHolder6)
  WindowedASE7 = mean(ASEHolder7)
  WindowedASE8 = mean(ASEHolder8)
  WindowedASE9 = mean(ASEHolder9)
  WindowedASE10 = mean(ASEHolder10)
  WindowedASE11 = mean(ASEHolder11)
  WindowedASE12 = mean(ASEHolder12)
  results_mean[i,paste0("EqualMeans_1_ASE")] = WindowedASE1
  results_mean[i,paste0("EqualMeans_2_ASE")] = WindowedASE2
  results_mean[i,paste0("EqualMeans_3_ASE")] = WindowedASE3
  results_mean[i,paste0("EqualMeans_4_ASE")] = WindowedASE4
  results_mean[i,paste0("EqualMeans_5_ASE")] = WindowedASE5
  results_mean[i,paste0("EqualMeans_6_ASE")] = WindowedASE6
  results_mean[i,paste0("EqualMeans_7_ASE")] = WindowedASE7
  results_mean[i,paste0("EqualMeans_8_ASE")] = WindowedASE8
  results_mean[i,paste0("EqualMeans_9_ASE")] = WindowedASE9
  results_mean[i,paste0("EqualMeans_10_ASE")] = WindowedASE10
  results_mean[i,paste0("EqualMeans_11_ASE")] = WindowedASE11
  results_mean[i,paste0("EqualMeans_12_ASE")] = WindowedASE12
  
  results_mean[i,paste0("EqualMeans_F1")] = model0_mean  
  results_mean[i,paste0("EqualMeans_F2")] = model0_mean  
  results_mean[i,paste0("EqualMeans_F3")] = model0_mean  
  results_mean[i,paste0("EqualMeans_F4")] = model0_mean  
  results_mean[i,paste0("EqualMeans_F5")] = model0_mean  
  results_mean[i,paste0("EqualMeans_F6")] = model0_mean  
  results_mean[i,paste0("EqualMeans_F7")] = model0_mean  
  results_mean[i,paste0("EqualMeans_F8")] = model0_mean  
  results_mean[i,paste0("EqualMeans_F9")] = model0_mean  
  results_mean[i,paste0("EqualMeans_F10")] = model0_mean  
  results_mean[i,paste0("EqualMeans_F11")] = model0_mean  
  results_mean[i,paste0("EqualMeans_F12")] = model0_mean  

  results_mean[i,paste0("ACTUAL_1")] = temp1$STD_Cases[73]
  results_mean[i,paste0("ACTUAL_2")] = temp1$STD_Cases[74]
  results_mean[i,paste0("ACTUAL_3")] = temp1$STD_Cases[75]
  results_mean[i,paste0("ACTUAL_4")] = temp1$STD_Cases[76]
  results_mean[i,paste0("ACTUAL_5")] = temp1$STD_Cases[77]
  results_mean[i,paste0("ACTUAL_6")] = temp1$STD_Cases[78]
  results_mean[i,paste0("ACTUAL_7")] = temp1$STD_Cases[79]
  results_mean[i,paste0("ACTUAL_8")] = temp1$STD_Cases[80]
  results_mean[i,paste0("ACTUAL_9")] = temp1$STD_Cases[81]
  results_mean[i,paste0("ACTUAL_10")] = temp1$STD_Cases[82]
  results_mean[i,paste0("ACTUAL_11")] = temp1$STD_Cases[83]
  results_mean[i,paste0("ACTUAL_12")] = temp1$STD_Cases[84]

}

Product_Type Product Customer EqualMeans_F1 EqualMeans_F2 EqualMeans_F3 EqualMeans_F4 EqualMeans_F5 EqualMeans_F6 EqualMeans_F7 EqualMeans_F8 EqualMeans_F9 EqualMeans_F10 EqualMeans_F11 EqualMeans_F12 ACTUAL_1 ACTUAL_2 ACTUAL_3 ACTUAL_4 ACTUAL_5 ACTUAL_6 ACTUAL_7 ACTUAL_8 ACTUAL_9 ACTUAL_10 ACTUAL_11 ACTUAL_12 EqualMeans_1_ASE EqualMeans_2_ASE EqualMeans_3_ASE EqualMeans_4_ASE EqualMeans_5_ASE EqualMeans_6_ASE EqualMeans_7_ASE EqualMeans_8_ASE EqualMeans_9_ASE EqualMeans_10_ASE EqualMeans_11_ASE EqualMeans_12_ASE winning_12
700005895 TAAKA VODKA 80 1L 700005895 0.4166667 0.4166667 0.4166667 0.4166667 0.4166667 0.4166667 0.4166667 0.4166667 0.4166667 0.4166667 0.4166667 0.4166667 1 2 0 2 2 0 2 2 2 2 2 2 0.4156197 0.4976709 0.5207479 0.5726709 0.6376709 0.6788675 0.7321032 0.7938248 0.8606339 0.9310043 1.0048970 1.0839957 EqualMeans_12_ASE
701000357 TAAKA VODKA 80 1L 701000357 0.6166667 0.6166667 0.6166667 0.6166667 0.6166667 0.6166667 0.6166667 0.6166667 0.6166667 0.6166667 0.6166667 0.6166667 0 0 0 0 0 0 0 0 0 0 0 0 0.3264744 0.3328846 0.3350214 0.3367308 0.3403205 0.3444231 0.3473535 0.3495513 0.3512607 0.3526282 0.3537471 0.3546795 EqualMeans_12_ASE
700005867 TAAKA VODKA 80 1L 700005867 0.2250000 0.2250000 0.2250000 0.2250000 0.2250000 0.2250000 0.2250000 0.2250000 0.2250000 0.2250000 0.2250000 0.2250000 1 1 0 0 0 0 1 0 0 0 0 1 0.2278045 0.2489583 0.2401976 0.2358173 0.2237019 0.2160524 0.2173649 0.2183494 0.2135595 0.2099840 0.2072917 0.2090011 EqualMeans_12_ASE
701001908 TAAKA VODKA 80 1L 701001908 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0 0 0 0 0 0 0 0 0 0 0 0 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 EqualMeans_12_ASE

Forecast by Product (Aggregated)


resultsa <- data.frame(ljung_10=double(),
                      ljung_24=double(),
                      ljung_results=character(),
                      top_5_bic=character(),
                      ADF=double(),
                      PP=double(),
                      KPSS=double(),
                      stationarity_results=character(),
                      EqualMeans_1_ASE=double(),
                      EqualMeans_2_ASE=double(),
                      EqualMeans_3_ASE=double(),
                      EqualMeans_4_ASE=double(),
                      EqualMeans_5_ASE=double(),
                      EqualMeans_6_ASE=double(),
                      EqualMeans_7_ASE=double(),
                      EqualMeans_8_ASE=double(),
                      EqualMeans_9_ASE=double(),
                      EqualMeans_10_ASE=double(),
                      EqualMeans_11_ASE=double(),
                      EqualMeans_12_ASE=double(),
                      EqualMeans_F1=double(),
                      EqualMeans_F2=double(),
                      EqualMeans_F3=double(),
                      EqualMeans_F4=double(),
                      EqualMeans_F5=double(),
                      EqualMeans_F6=double(),
                      EqualMeans_F7=double(),
                      EqualMeans_F8=double(),
                      EqualMeans_F9=double(),
                      EqualMeans_F10=double(),
                      EqualMeans_F11=double(),
                      EqualMeans_F12=double(),
                      ARMA_1_ASE=double(),
                      ARMA_2_ASE=double(),
                      ARMA_3_ASE=double(),
                      ARMA_4_ASE=double(),
                      ARMA_5_ASE=double(),
                      ARMA_6_ASE=double(),
                      ARMA_7_ASE=double(),
                      ARMA_8_ASE=double(),
                      ARMA_9_ASE=double(),
                      ARMA_10_ASE=double(),
                      ARMA_11_ASE=double(),
                      ARMA_12_ASE=double(),
                      ARMA_F1=double(),
                      ARMA_F2=double(),
                      ARMA_F3=double(),
                      ARMA_F4=double(),
                      ARMA_F5=double(),
                      ARMA_F6=double(),
                      ARMA_F7=double(),
                      ARMA_F8=double(),
                      ARMA_F9=double(),
                      ARMA_F10=double(),
                      ARMA_F11=double(),
                      ARMA_F12=double(),
                      ARIMA_1_ASE=double(),
                      ARIMA_2_ASE=double(),
                      ARIMA_3_ASE=double(),
                      ARIMA_4_ASE=double(),
                      ARIMA_5_ASE=double(),
                      ARIMA_6_ASE=double(),
                      ARIMA_7_ASE=double(),
                      ARIMA_8_ASE=double(),
                      ARIMA_9_ASE=double(),
                      ARIMA_10_ASE=double(),
                      ARIMA_11_ASE=double(),
                      ARIMA_12_ASE=double(),
                      ARIMA_F1=double(),
                      ARIMA_F2=double(),
                      ARIMA_F3=double(),
                      ARIMA_F4=double(),
                      ARIMA_F5=double(),
                      ARIMA_F6=double(),
                      ARIMA_F7=double(),
                      ARIMA_F8=double(),
                      ARIMA_F9=double(),
                      ARIMA_F10=double(),
                      ARIMA_F11=double(),
                      ARIMA_F12=double(),
                      ARIMA_S12_1_ASE=double(),
                      ARIMA_S12_2_ASE=double(),
                      ARIMA_S12_3_ASE=double(),
                      ARIMA_S12_4_ASE=double(),
                      ARIMA_S12_5_ASE=double(),
                      ARIMA_S12_6_ASE=double(),
                      ARIMA_S12_7_ASE=double(),
                      ARIMA_S12_8_ASE=double(),
                      ARIMA_S12_9_ASE=double(),
                      ARIMA_S12_10_ASE=double(),
                      ARIMA_S12_11_ASE=double(),
                      ARIMA_S12_12_ASE=double(),
                      ARIMA_S12_F1=double(),
                      ARIMA_S12_F2=double(),
                      ARIMA_S12_F3=double(),
                      ARIMA_S12_F4=double(),
                      ARIMA_S12_F5=double(),
                      ARIMA_S12_F6=double(),
                      ARIMA_S12_F7=double(),
                      ARIMA_S12_F8=double(),
                      ARIMA_S12_F9=double(),
                      ARIMA_S12_F10=double(),
                      ARIMA_S12_F11=double(),
                      ARIMA_S12_F12=double(),
                      ACTUAL_1=double(),
                      ACTUAL_2=double(),
                      ACTUAL_3=double(),
                      ACTUAL_4=double(),
                      ACTUAL_5=double(),
                      ACTUAL_6=double(),
                      ACTUAL_7=double(),
                      ACTUAL_8=double(),
                      ACTUAL_9=double(),
                      ACTUAL_10=double(),
                      ACTUAL_11=double(),
                      ACTUAL_12=double(),
                      stringsAsFactors = FALSE)

# loop through sample combinations
  i=1
  temp1 = df_taaka_summarized

  par(mfrow=c(1,1))
  plot.ts(temp1$STD_Cases, 
          main="TAAKA VODKA 80  1L",
          xlab="Months",
          ylab="Standard Cases")

Obs 0.581064 0.2907099 0.09796717 -0.002900433 0.1054023 0.1422157 0.06115488 0.0360746 -0.1158591 -0.1599279 
The Ljung-Box test with K=10 has a p-value of 2.322229e-06 .
Obs 0.581064 0.2907099 0.09796717 -0.002900433 0.1054023 0.1422157 0.06115488 0.0360746 -0.1158591 -0.1599279 -0.1164521 -0.0414574 0.03658722 0.1325334 0.08610644 -0.1175143 -0.1852131 -0.1792189 -0.07936305 0.08417133 0.0944759 0.02650935 -0.07443002 -0.1870262 
The Ljung-Box test with K=24 has a p-value of 1.124084e-05 .
[1] "Ljung-Box test results: At a significance level of 0.05, we reject the null hypothesis that this dataset is white noise."
---------WORKING... PLEASE WAIT... 


Five Smallest Values of  bic 
[1] "Both tests for stationarity were inconclusive."
  j=12
  
  #Equal Means Model
  
  trainingSize = 60
  ASEHolder1 = numeric()
  ASEHolder2 = numeric()
  ASEHolder3 = numeric()
  ASEHolder4 = numeric()
  ASEHolder5 = numeric()
  ASEHolder6 = numeric()
  ASEHolder7 = numeric()
  ASEHolder8 = numeric()
  ASEHolder9 = numeric()
  ASEHolder10 = numeric()
  ASEHolder11 = numeric()
  ASEHolder12 = numeric()

  for( k in 1:(84-(trainingSize + j) + 1))
  {
    sink("file")
    model0_mean = mean(temp1$STD_Cases[k:(k+(trainingSize-1))])
    ASEHolder1[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 1 - 1)] - model0_mean)^2)
    ASEHolder2[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 2 - 1)] - model0_mean)^2)
    ASEHolder3[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 3 - 1)] - model0_mean)^2)
    ASEHolder4[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 4 - 1)] - model0_mean)^2)
    ASEHolder5[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 5 - 1)] - model0_mean)^2)
    ASEHolder6[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 6 - 1)] - model0_mean)^2)
    ASEHolder7[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 7 - 1)] - model0_mean)^2)
    ASEHolder8[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 8 - 1)] - model0_mean)^2)
    ASEHolder9[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 9 - 1)] - model0_mean)^2)
    ASEHolder10[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 10 - 1)] - model0_mean)^2)
    ASEHolder11[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 11 - 1)] - model0_mean)^2)
    ASEHolder12[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 12 - 1)] - model0_mean)^2)
    
    sink()
    
    assign(paste("EqualMeans_Results_",k,sep=""),(temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + j - 1)] - model0_mean)^2)
  }
  
  WindowedASE1 = mean(ASEHolder1)
  WindowedASE2 = mean(ASEHolder2)
  WindowedASE3 = mean(ASEHolder3)
  WindowedASE4 = mean(ASEHolder4)
  WindowedASE5 = mean(ASEHolder5)
  WindowedASE6 = mean(ASEHolder6)
  WindowedASE7 = mean(ASEHolder7)
  WindowedASE8 = mean(ASEHolder8)
  WindowedASE9 = mean(ASEHolder9)
  WindowedASE10 = mean(ASEHolder10)
  WindowedASE11 = mean(ASEHolder11)
  WindowedASE12 = mean(ASEHolder12)
  resultsa[i,paste0("EqualMeans_1_ASE")] = WindowedASE1
  resultsa[i,paste0("EqualMeans_2_ASE")] = WindowedASE2
  resultsa[i,paste0("EqualMeans_3_ASE")] = WindowedASE3
  resultsa[i,paste0("EqualMeans_4_ASE")] = WindowedASE4
  resultsa[i,paste0("EqualMeans_5_ASE")] = WindowedASE5
  resultsa[i,paste0("EqualMeans_6_ASE")] = WindowedASE6
  resultsa[i,paste0("EqualMeans_7_ASE")] = WindowedASE7
  resultsa[i,paste0("EqualMeans_8_ASE")] = WindowedASE8
  resultsa[i,paste0("EqualMeans_9_ASE")] = WindowedASE9
  resultsa[i,paste0("EqualMeans_10_ASE")] = WindowedASE10
  resultsa[i,paste0("EqualMeans_11_ASE")] = WindowedASE11
  resultsa[i,paste0("EqualMeans_12_ASE")] = WindowedASE12
  
  resultsa[i,paste0("EqualMeans_F1")] = model0_mean  
  resultsa[i,paste0("EqualMeans_F2")] = model0_mean  
  resultsa[i,paste0("EqualMeans_F3")] = model0_mean  
  resultsa[i,paste0("EqualMeans_F4")] = model0_mean  
  resultsa[i,paste0("EqualMeans_F5")] = model0_mean  
  resultsa[i,paste0("EqualMeans_F6")] = model0_mean  
  resultsa[i,paste0("EqualMeans_F7")] = model0_mean  
  resultsa[i,paste0("EqualMeans_F8")] = model0_mean  
  resultsa[i,paste0("EqualMeans_F9")] = model0_mean  
  resultsa[i,paste0("EqualMeans_F10")] = model0_mean  
  resultsa[i,paste0("EqualMeans_F11")] = model0_mean  
  resultsa[i,paste0("EqualMeans_F12")] = model0_mean  
  

  #ARMA Model
  
  trainingSize = 60
  ASEHolder1 = numeric()
  ASEHolder2 = numeric()
  ASEHolder3 = numeric()
  ASEHolder4 = numeric()
  ASEHolder5 = numeric()
  ASEHolder6 = numeric()
  ASEHolder7 = numeric()
  ASEHolder8 = numeric()
  ASEHolder9 = numeric()
  ASEHolder10 = numeric()
  ASEHolder11 = numeric()
  ASEHolder12 = numeric()
  
  for( k in 1:(84-(trainingSize + j) + 1))
  {
    sink("file")
    model1 = invisible(aic.wge(temp1$STD_Cases[k:(k+(trainingSize-1))],type="aic"))
    model1_est = invisible(est.arma.wge(temp1$STD_Cases[k:(k+(trainingSize-1))],p=model1$p,q=model1$q))
    forecasts = fore.aruma.wge(temp1$STD_Cases[k:(k+(trainingSize-1))],phi = model1_est$phi, theta = model1_est$theta, s = 0, d = 0,n.ahead = j,plot=FALSE)

    ASEHolder1[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 1 - 1)] - forecasts$f[1:1])^2)
    ASEHolder2[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 2 - 1)] - forecasts$f[1:2])^2)
    ASEHolder3[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 3 - 1)] - forecasts$f[1:3])^2)
    ASEHolder4[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 4 - 1)] - forecasts$f[1:4])^2)
    ASEHolder5[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 5 - 1)] - forecasts$f[1:5])^2)
    ASEHolder6[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 6 - 1)] - forecasts$f[1:6])^2)
    ASEHolder7[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 7 - 1)] - forecasts$f[1:7])^2)
    ASEHolder8[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 8 - 1)] - forecasts$f[1:8])^2)
    ASEHolder9[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 9 - 1)] - forecasts$f[1:9])^2)
    ASEHolder10[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 10 - 1)] - forecasts$f[1:10])^2)
    ASEHolder11[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 11 - 1)] - forecasts$f[1:11])^2)
    ASEHolder12[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 12 - 1)] - forecasts$f[1:12])^2)
    
    sink()
    
    assign(paste("ARMA_Results_",k,sep=""),(temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + j - 1)] - forecasts$f)^2)

  }
  
  WindowedASE1 = mean(ASEHolder1)
  WindowedASE2 = mean(ASEHolder2)
  WindowedASE3 = mean(ASEHolder3)
  WindowedASE4 = mean(ASEHolder4)
  WindowedASE5 = mean(ASEHolder5)
  WindowedASE6 = mean(ASEHolder6)
  WindowedASE7 = mean(ASEHolder7)
  WindowedASE8 = mean(ASEHolder8)
  WindowedASE9 = mean(ASEHolder9)
  WindowedASE10 = mean(ASEHolder10)
  WindowedASE11 = mean(ASEHolder11)
  WindowedASE12 = mean(ASEHolder12)
  resultsa[i,paste0("ARMA_1_ASE")] = WindowedASE1
  resultsa[i,paste0("ARMA_2_ASE")] = WindowedASE2
  resultsa[i,paste0("ARMA_3_ASE")] = WindowedASE3
  resultsa[i,paste0("ARMA_4_ASE")] = WindowedASE4
  resultsa[i,paste0("ARMA_5_ASE")] = WindowedASE5
  resultsa[i,paste0("ARMA_6_ASE")] = WindowedASE6
  resultsa[i,paste0("ARMA_7_ASE")] = WindowedASE7
  resultsa[i,paste0("ARMA_8_ASE")] = WindowedASE8
  resultsa[i,paste0("ARMA_9_ASE")] = WindowedASE9
  resultsa[i,paste0("ARMA_10_ASE")] = WindowedASE10
  resultsa[i,paste0("ARMA_11_ASE")] = WindowedASE11
  resultsa[i,paste0("ARMA_12_ASE")] = WindowedASE12
  
  resultsa[i,paste0("ARMA_F1")] = forecasts$f[1]  
  resultsa[i,paste0("ARMA_F2")] = forecasts$f[2]   
  resultsa[i,paste0("ARMA_F3")] = forecasts$f[3]   
  resultsa[i,paste0("ARMA_F4")] = forecasts$f[4]   
  resultsa[i,paste0("ARMA_F5")] = forecasts$f[5]   
  resultsa[i,paste0("ARMA_F6")] = forecasts$f[6]   
  resultsa[i,paste0("ARMA_F7")] = forecasts$f[7]   
  resultsa[i,paste0("ARMA_F8")] = forecasts$f[8]   
  resultsa[i,paste0("ARMA_F9")] = forecasts$f[9]   
  resultsa[i,paste0("ARMA_F10")] = forecasts$f[10]   
  resultsa[i,paste0("ARMA_F11")] = forecasts$f[11]   
  resultsa[i,paste0("ARMA_F12")] = forecasts$f[12]   
  
  #ARIMA Model with d=1
  nulldev()
  temp2 = artrans.wge(temp1$STD_Cases,1)
  dev.off()
png 
  2 
  trainingSize = 60
  ASEHolder1 = numeric()
  ASEHolder2 = numeric()
  ASEHolder3 = numeric()
  ASEHolder4 = numeric()
  ASEHolder5 = numeric()
  ASEHolder6 = numeric()
  ASEHolder7 = numeric()
  ASEHolder8 = numeric()
  ASEHolder9 = numeric()
  ASEHolder10 = numeric()
  ASEHolder11 = numeric()
  ASEHolder12 = numeric()
    
  for( k in 1:(84-(trainingSize + j) + 1))
  {
    sink("file")
    model1 = invisible(aic.wge(temp2[k:(k+(trainingSize-1-1))],type="aic"))
    model1_est = invisible(est.arma.wge(temp2[k:(k+(trainingSize-1-1))],p=model1$p,q=model1$q))
    forecasts = fore.aruma.wge(temp1$STD_Cases[k:(k+(trainingSize-1))],phi = model1_est$phi, theta = model1_est$theta, s = 0, d = 1,n.ahead = j,plot=FALSE)
    ASEHolder1[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 1 - 1)] - forecasts$f[1:1])^2)
    ASEHolder2[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 2 - 1)] - forecasts$f[1:2])^2)
    ASEHolder3[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 3 - 1)] - forecasts$f[1:3])^2)
    ASEHolder4[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 4 - 1)] - forecasts$f[1:4])^2)
    ASEHolder5[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 5 - 1)] - forecasts$f[1:5])^2)
    ASEHolder6[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 6 - 1)] - forecasts$f[1:6])^2)
    ASEHolder7[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 7 - 1)] - forecasts$f[1:7])^2)
    ASEHolder8[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 8 - 1)] - forecasts$f[1:8])^2)
    ASEHolder9[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 9 - 1)] - forecasts$f[1:9])^2)
    ASEHolder10[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 10 - 1)] - forecasts$f[1:10])^2)
    ASEHolder11[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 11 - 1)] - forecasts$f[1:11])^2)
    ASEHolder12[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 12 - 1)] - forecasts$f[1:12])^2)
    
    sink()
    
    assign(paste("ARIMA_Results_",k,sep=""),(temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + j - 1)] - forecasts$f)^2)

  }
  
  WindowedASE1 = mean(ASEHolder1)
  WindowedASE2 = mean(ASEHolder2)
  WindowedASE3 = mean(ASEHolder3)
  WindowedASE4 = mean(ASEHolder4)
  WindowedASE5 = mean(ASEHolder5)
  WindowedASE6 = mean(ASEHolder6)
  WindowedASE7 = mean(ASEHolder7)
  WindowedASE8 = mean(ASEHolder8)
  WindowedASE9 = mean(ASEHolder9)
  WindowedASE10 = mean(ASEHolder10)
  WindowedASE11 = mean(ASEHolder11)
  WindowedASE12 = mean(ASEHolder12)
  resultsa[i,paste0("ARIMA_1_ASE")] = WindowedASE1
  resultsa[i,paste0("ARIMA_2_ASE")] = WindowedASE2
  resultsa[i,paste0("ARIMA_3_ASE")] = WindowedASE3
  resultsa[i,paste0("ARIMA_4_ASE")] = WindowedASE4
  resultsa[i,paste0("ARIMA_5_ASE")] = WindowedASE5
  resultsa[i,paste0("ARIMA_6_ASE")] = WindowedASE6
  resultsa[i,paste0("ARIMA_7_ASE")] = WindowedASE7
  resultsa[i,paste0("ARIMA_8_ASE")] = WindowedASE8
  resultsa[i,paste0("ARIMA_9_ASE")] = WindowedASE9
  resultsa[i,paste0("ARIMA_10_ASE")] = WindowedASE10
  resultsa[i,paste0("ARIMA_11_ASE")] = WindowedASE11
  resultsa[i,paste0("ARIMA_12_ASE")] = WindowedASE12
  
  resultsa[i,paste0("ARIMA_F1")] = forecasts$f[1]  
  resultsa[i,paste0("ARIMA_F2")] = forecasts$f[2]   
  resultsa[i,paste0("ARIMA_F3")] = forecasts$f[3]   
  resultsa[i,paste0("ARIMA_F4")] = forecasts$f[4]   
  resultsa[i,paste0("ARIMA_F5")] = forecasts$f[5]   
  resultsa[i,paste0("ARIMA_F6")] = forecasts$f[6]   
  resultsa[i,paste0("ARIMA_F7")] = forecasts$f[7]   
  resultsa[i,paste0("ARIMA_F8")] = forecasts$f[8]   
  resultsa[i,paste0("ARIMA_F9")] = forecasts$f[9]   
  resultsa[i,paste0("ARIMA_F10")] = forecasts$f[10]   
  resultsa[i,paste0("ARIMA_F11")] = forecasts$f[11]   
  resultsa[i,paste0("ARIMA_F12")] = forecasts$f[12] 
  
  
  #ARIMA Model with S=12
  nulldev()
  temp2 = artrans.wge(temp1$STD_Cases,phi.tr=c(rep(0,11),1))
  dev.off()
png 
  2 
  trainingSize = 60
  ASEHolder1 = numeric()
  ASEHolder2 = numeric()
  ASEHolder3 = numeric()
  ASEHolder4 = numeric()
  ASEHolder5 = numeric()
  ASEHolder6 = numeric()
  ASEHolder7 = numeric()
  ASEHolder8 = numeric()
  ASEHolder9 = numeric()
  ASEHolder10 = numeric()
  ASEHolder11 = numeric()
  ASEHolder12 = numeric()
  
  for( k in 1:(84-(trainingSize + j) + 1))
  {
    sink("file")
    model1 = invisible(aic.wge(temp2[k:(k+(trainingSize-1-12))],type="aic"))
    model1_est = invisible(est.arma.wge(temp2[k:(k+(trainingSize-1-12))],p=model1$p,q=model1$q))
    forecasts = fore.aruma.wge(temp1$STD_Cases[k:(k+(trainingSize-1))],phi = model1_est$phi, theta = model1_est$theta, s = 12, d = 0,n.ahead = j,plot=FALSE)
    ASEHolder1[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 1 - 1)] - forecasts$f[1:1])^2)
    ASEHolder2[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 2 - 1)] - forecasts$f[1:2])^2)
    ASEHolder3[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 3 - 1)] - forecasts$f[1:3])^2)
    ASEHolder4[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 4 - 1)] - forecasts$f[1:4])^2)
    ASEHolder5[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 5 - 1)] - forecasts$f[1:5])^2)
    ASEHolder6[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 6 - 1)] - forecasts$f[1:6])^2)
    ASEHolder7[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 7 - 1)] - forecasts$f[1:7])^2)
    ASEHolder8[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 8 - 1)] - forecasts$f[1:8])^2)
    ASEHolder9[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 9 - 1)] - forecasts$f[1:9])^2)
    ASEHolder10[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 10 - 1)] - forecasts$f[1:10])^2)
    ASEHolder11[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 11 - 1)] - forecasts$f[1:11])^2)
    ASEHolder12[k] = mean((temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + 12 - 1)] - forecasts$f[1:12])^2)
    
    sink()
    
    assign(paste("ARIMAS_Results_",k,sep=""),(temp1$STD_Cases[(trainingSize+k):(trainingSize+ k + j - 1)] - forecasts$f)^2)

  }
  
  WindowedASE1 = mean(ASEHolder1)
  WindowedASE2 = mean(ASEHolder2)
  WindowedASE3 = mean(ASEHolder3)
  WindowedASE4 = mean(ASEHolder4)
  WindowedASE5 = mean(ASEHolder5)
  WindowedASE6 = mean(ASEHolder6)
  WindowedASE7 = mean(ASEHolder7)
  WindowedASE8 = mean(ASEHolder8)
  WindowedASE9 = mean(ASEHolder9)
  WindowedASE10 = mean(ASEHolder10)
  WindowedASE11 = mean(ASEHolder11)
  WindowedASE12 = mean(ASEHolder12)
  resultsa[i,paste0("ARIMA_S12_1_ASE")] = WindowedASE1
  resultsa[i,paste0("ARIMA_S12_2_ASE")] = WindowedASE2
  resultsa[i,paste0("ARIMA_S12_3_ASE")] = WindowedASE3
  resultsa[i,paste0("ARIMA_S12_4_ASE")] = WindowedASE4
  resultsa[i,paste0("ARIMA_S12_5_ASE")] = WindowedASE5
  resultsa[i,paste0("ARIMA_S12_6_ASE")] = WindowedASE6
  resultsa[i,paste0("ARIMA_S12_7_ASE")] = WindowedASE7
  resultsa[i,paste0("ARIMA_S12_8_ASE")] = WindowedASE8
  resultsa[i,paste0("ARIMA_S12_9_ASE")] = WindowedASE9
  resultsa[i,paste0("ARIMA_S12_10_ASE")] = WindowedASE10
  resultsa[i,paste0("ARIMA_S12_11_ASE")] = WindowedASE11
  resultsa[i,paste0("ARIMA_S12_12_ASE")] = WindowedASE12

  resultsa[i,paste0("ARIMA_S12_F1")] = forecasts$f[1]  
  resultsa[i,paste0("ARIMA_S12_F2")] = forecasts$f[2]   
  resultsa[i,paste0("ARIMA_S12_F3")] = forecasts$f[3]   
  resultsa[i,paste0("ARIMA_S12_F4")] = forecasts$f[4]   
  resultsa[i,paste0("ARIMA_S12_F5")] = forecasts$f[5]   
  resultsa[i,paste0("ARIMA_S12_F6")] = forecasts$f[6]   
  resultsa[i,paste0("ARIMA_S12_F7")] = forecasts$f[7]   
  resultsa[i,paste0("ARIMA_S12_F8")] = forecasts$f[8]   
  resultsa[i,paste0("ARIMA_S12_F9")] = forecasts$f[9]   
  resultsa[i,paste0("ARIMA_S12_F10")] = forecasts$f[10]   
  resultsa[i,paste0("ARIMA_S12_F11")] = forecasts$f[11]   
  resultsa[i,paste0("ARIMA_S12_F12")] = forecasts$f[12]   
  
  
  resultsa[i,paste0("ACTUAL_1")] = temp1$STD_Cases[73]
  resultsa[i,paste0("ACTUAL_2")] = temp1$STD_Cases[74]
  resultsa[i,paste0("ACTUAL_3")] = temp1$STD_Cases[75]
  resultsa[i,paste0("ACTUAL_4")] = temp1$STD_Cases[76]
  resultsa[i,paste0("ACTUAL_5")] = temp1$STD_Cases[77]
  resultsa[i,paste0("ACTUAL_6")] = temp1$STD_Cases[78]
  resultsa[i,paste0("ACTUAL_7")] = temp1$STD_Cases[79]
  resultsa[i,paste0("ACTUAL_8")] = temp1$STD_Cases[80]
  resultsa[i,paste0("ACTUAL_9")] = temp1$STD_Cases[81]
  resultsa[i,paste0("ACTUAL_10")] = temp1$STD_Cases[82]
  resultsa[i,paste0("ACTUAL_11")] = temp1$STD_Cases[83]
  resultsa[i,paste0("ACTUAL_12")] = temp1$STD_Cases[84]
  
  #graph ASEs for each Model
  EqualMeans_Results <- rbind(EqualMeans_Results_1,EqualMeans_Results_2,EqualMeans_Results_3,EqualMeans_Results_4,EqualMeans_Results_5,EqualMeans_Results_6,
                              EqualMeans_Results_7,EqualMeans_Results_8,EqualMeans_Results_9,EqualMeans_Results_10,EqualMeans_Results_11,EqualMeans_Results_12,
                              EqualMeans_Results_13)
  
  ARMA_Results <- rbind(ARMA_Results_1,ARMA_Results_2,ARMA_Results_3,ARMA_Results_4,ARMA_Results_5,ARMA_Results_6,ARMA_Results_7,ARMA_Results_8,
                       ARMA_Results_9,ARMA_Results_10,ARMA_Results_11,ARMA_Results_12,ARMA_Results_13)

  ARIMA_Results <- rbind(ARIMA_Results_1,ARIMA_Results_2,ARIMA_Results_3,ARIMA_Results_4,ARIMA_Results_5,ARIMA_Results_6,ARIMA_Results_7,ARIMA_Results_8,
                         ARIMA_Results_9,ARIMA_Results_10,ARIMA_Results_11,ARIMA_Results_12,ARIMA_Results_13)
      
  ARIMAS_Results <- rbind(ARIMAS_Results_1,ARIMAS_Results_2,ARIMAS_Results_3,ARIMAS_Results_4,ARIMAS_Results_5,ARIMAS_Results_6,ARIMAS_Results_7,ARIMAS_Results_8,
                          ARIMAS_Results_9,ARIMAS_Results_10,ARIMAS_Results_11,ARIMAS_Results_12,ARIMAS_Results_13)
      
  EqualMeans_Means <- colMeans(EqualMeans_Results)
  ARMA_Means <- colMeans(ARMA_Results)
  ARIMA_Means <- colMeans(ARIMA_Results)
  ARIMAS_Means <- colMeans(ARIMAS_Results)
  Combined_Means <- data.frame(EqualMeans_Means,ARMA_Means, ARIMA_Means, ARIMAS_Means)
  Combined_Means$horizon <- as.numeric(row.names(Combined_Means))
  

  g <- ggplot(data=Combined_Means, aes(horizon)) +
    geom_line(aes(y=EqualMeans_Means, color="Equal Means"),size=1.5) +
    geom_line(aes(y=ARMA_Means, color="ARMA"),size=1.5) +
    geom_line(aes(y=ARIMA_Means, color="ARIMA"),size=1.5) +
    geom_line(aes(y=ARIMAS_Means, color="ARIMAS"),size=1.5) +
    scale_color_manual(values = c(
      'Equal Means' = '#58508d',
      'ARMA' = '#bc5090',
      'ARIMA' = '#ff6361',
      'ARIMAS' = '#ffa600'
    )) +
    labs(color='Models') +
    scale_x_continuous(breaks=seq(0,13,1)) +
    ggtitle(paste("Model ASEs for ", product,"and Customer",customer)) +
    xlab("Month Ahead Forecast") +
    ylab("ASE") +
    theme(panel.background = element_blank(), axis.line = element_line(colour = "black"), legend.title = element_blank())
  
  print(g)

ljung_10 ljung_24 ljung_results top_5_bic ADF PP KPSS stationarity_results EqualMeans_1_ASE EqualMeans_2_ASE EqualMeans_3_ASE EqualMeans_4_ASE EqualMeans_5_ASE EqualMeans_6_ASE EqualMeans_7_ASE EqualMeans_8_ASE EqualMeans_9_ASE EqualMeans_10_ASE EqualMeans_11_ASE EqualMeans_12_ASE EqualMeans_F1 EqualMeans_F2 EqualMeans_F3 EqualMeans_F4 EqualMeans_F5 EqualMeans_F6 EqualMeans_F7 EqualMeans_F8 EqualMeans_F9 EqualMeans_F10 EqualMeans_F11 EqualMeans_F12 ARMA_1_ASE ARMA_2_ASE ARMA_3_ASE ARMA_4_ASE ARMA_5_ASE ARMA_6_ASE ARMA_7_ASE ARMA_8_ASE ARMA_9_ASE ARMA_10_ASE ARMA_11_ASE ARMA_12_ASE ARMA_F1 ARMA_F2 ARMA_F3 ARMA_F4 ARMA_F5 ARMA_F6 ARMA_F7 ARMA_F8 ARMA_F9 ARMA_F10 ARMA_F11 ARMA_F12 ARIMA_1_ASE ARIMA_2_ASE ARIMA_3_ASE ARIMA_4_ASE ARIMA_5_ASE ARIMA_6_ASE ARIMA_7_ASE ARIMA_8_ASE ARIMA_9_ASE ARIMA_10_ASE ARIMA_11_ASE ARIMA_12_ASE ARIMA_F1 ARIMA_F2 ARIMA_F3 ARIMA_F4 ARIMA_F5 ARIMA_F6 ARIMA_F7 ARIMA_F8 ARIMA_F9 ARIMA_F10 ARIMA_F11 ARIMA_F12 ARIMA_S12_1_ASE ARIMA_S12_2_ASE ARIMA_S12_3_ASE ARIMA_S12_4_ASE ARIMA_S12_5_ASE ARIMA_S12_6_ASE ARIMA_S12_7_ASE ARIMA_S12_8_ASE ARIMA_S12_9_ASE ARIMA_S12_10_ASE ARIMA_S12_11_ASE ARIMA_S12_12_ASE ARIMA_S12_F1 ARIMA_S12_F2 ARIMA_S12_F3 ARIMA_S12_F4 ARIMA_S12_F5 ARIMA_S12_F6 ARIMA_S12_F7 ARIMA_S12_F8 ARIMA_S12_F9 ARIMA_S12_F10 ARIMA_S12_F11 ARIMA_S12_F12 ACTUAL_1 ACTUAL_2 ACTUAL_3 ACTUAL_4 ACTUAL_5 ACTUAL_6 ACTUAL_7 ACTUAL_8 ACTUAL_9 ACTUAL_10 ACTUAL_11 ACTUAL_12 winning_12
2.322229e-06 1.124084e-05 not white noise NA 0.3279525 0.01 0.1 inconclusive 4059.231 3679.643 3401.196 3372.65 3330.088 3663.9 4022.845 4369.204 4647.175 4822.214 4991.421 5189.347 387.7917 387.7917 387.7917 387.7917 387.7917 387.7917 387.7917 387.7917 387.7917 387.7917 387.7917 387.7917 3173.814 3540.745 3475.842 3562.13 3495.253 3772.052 4094.861 4425.126 4696.629 4868.098 5034.353 5228.588 325.3383 350.9228 366.0264 374.9427 380.2064 383.3137 385.1482 386.2311 386.8704 387.2478 387.4706 387.6021 7105.365 12887.81 15588.65 18324.48 19097.58 18725.51 18836.91 20251.35 21113.27 21670.1 21527.4 20880.61 244.7304 221.902 207.9192 199.3544 194.1084 190.8951 188.9268 187.7213 186.9828 186.5305 186.2535 186.0838 7755.406 8228.346 9375.721 9464.392 9215.362 9205.438 9316.413 9585.313 9869.667 10090.96 10043.93 9989.717 416.2036 403.062 299.9213 407.1609 345.28 354.6572 399.4513 418.6447 443.691 404.1049 331.5171 281.7067 290.9 430 401 484 350.9 220 289.9 297.9 327.8 363.9 310 278.9 EqualMeans_12_ASE